Cod sursa(job #36448)
Utilizator | Data | 23 martie 2007 16:20:37 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include <fstream.h>
#include <math.h>
int main(){
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);
g<<s%10<<"\n";
k--;
}
return 0;
}