Source Code
#include <iostream>
using namespace std;

int main() {
	int n;
	int counter = 0;
	cin >> n;
	int arr[100000];
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		while (arr[i] >= 10) {

			arr[i] /= 10;

		}
		counter += arr[i];

	}
	cout << counter << endl;
	return 0;
}
Copy
The Tale of a Generous Prince yaman
GNU G++17
3 ms
720 KB
Wrong Answer