Cod sursa(job #16467)
Utilizator | Data | 13 februarie 2007 10:41:06 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <stdio.h>
int main()
{
long long int n, j, g, t, i, p ,c, u;
freopen("cifra.in", "r", stdin);
freopen("cifra.out", "w", stdout);
scanf("%d\n", &t);
for (i=1; i<=t; i++)
{
scanf("%lld\n", &n);
for (j=1; j<=n; j++)
{
for (g=1; g<=n; g++)
{
c=j%10;
p=c;
c=c*p;
c=c%10;
}
u=u+c;
u=u%10;
}
printf("%d", u);
}
return 0;
}