Source Code

using namespace std;
#include<string>
#include <iostream>

int main(){

	int  n,x,sum=0;
	
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> x;
		sum = sum + x;
	}

	while (sum>=10)
	{
		sum = sum / 10;
	}
	cout << sum;



}
Copy
The Tale of a Generous Prince hatamleh
GNU G++17
3 ms
752 KB
Wrong Answer