Răspuns :
#include <iostream>
using namespace std;
int main()
{
unsigned int suma,n;
cin >> n;
suma=(n*(n+1))/2;
cout << suma%10;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
unsigned int suma,n;
cin >> n;
suma=(n*(n+1))/2;
cout << suma%10;
return 0;
}