Uite aici un program care functioneaza (e testat de mine):
#include <iostream>
using namespace std;
int main()
{
int n, s = 0, x, i;
cin >> n;
for(i = 0; i < n; i++)
{
cin >> x;
while(x > 9)
x /= 10;
s += x;
}
cout << "Suma primelor cifre: " << s << endl;
return 0;
}