Cod sursa(job #395387)
Utilizator | Data | 12 februarie 2010 22:39:56 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<iostream.h>
#include<fstream.h>
int main()
{int T,r,o,t;
long N,x,e;
fstream f("cifra.in",ios::in),g("cifra.out",ios::out);
f>>T>>N;
for (o=0;o<T;o++)
{e=0;
for (x=1;x<=N;x++)
{r=1;
for (t=0;t<x;t++)
r=r*x;
e=e+r;
}
g<<(e%10)<<endl;
f>>N;
}
}