Cod sursa(job #763296)

Utilizator icb_mnStf Cic icb_mn Data 1 iulie 2012 16:33:17
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<fstream>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");


double aux1,s,n,i,j,aux,k;
long y;
int main()
{
	f>>n;
	for(i = 1; i <= n; ++i)
	{
		s = 0;
		f>>aux;
		for(j = 1; j <= aux; j++)
		{
			aux1 = pow(j,j);
			s += aux1;
		}
		y = int(s);
		g<<y % 10<<'\n';
	}
	
	return 0;
}