Cod sursa(job #768354)

Utilizator patratzelAlex Alex patratzel Data 16 iulie 2012 17:39:55
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include<fstream>
#include<math.h>
using namespace std;
ifstream fin("cifra.in");
ofstream fout("cifra.out");
int T,i,N,s;
double j,v[30000];
int main()
{ fin>>T;
  for(i=0;i<T;i++)
	{
      fin>>v[i];
	  s=0;
	for(j=1;j<=v[i];j++)
		{ 
			 s+=pow(j,j);
		}
	 fout<<"\n"<<s%10; 
    }
fin.close();
fout.close();
return 0;
}