Source Code
#include <iostream>
using namespace std;

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

			sum/= 10;

		}
		

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