Cod sursa(job #944678)
Utilizator | Data | 29 aprilie 2013 13:51:46 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
// 1 4 9 6 5 6 9 4 1 0 =5
#include<iostream.h>
int i,s,n;
void main()
{
cin>>n;
n%=20;
if(n<=11)
{
s=0;
for(i=1;i<=n;i++)
s+=i*i;
}
else
{
n%=10;
s=5;
for(i=1;i<=n;i++)
s+=i*i;
};
s%=10;
cout<<s;
}