Cod sursa(job #36117)
Utilizator | Data | 22 martie 2007 23:37:04 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <fstream.h>
#include <math.h>
int main(){
unsigned long long a,k,s,i;
ifstream f("cifra.in");
ofstream g("cifra.out");
f>>k;
while(k){
f>>a;s=0;
for(i=1;i<=a;i++)
s+=pow(i%10,i%10);
g<<s%10<<"\n";
k--;
}
return 0;
}