Cod sursa(job #254864)

Utilizator mathboyDragos-Alin Rotaru mathboy Data 7 februarie 2009 21:21:41
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include <fstream.h>
#include <math.h>
ifstream f("cifra.in");
ofstream g("cifra.out");
int main()
 {
long unsigned t,n,s,i,j;
f>>t;
for(i=1;i<=t;i++)
	{ f>>n;s=0;
     for(j=1;j<=n;j++) s=s+pow(j%10,j%10);
     g<<s%10<<"\n";  }
     return 0; }