Cod sursa(job #358924)

Utilizator bghimisFMI Ghimis Bogdan bghimis Data 24 octombrie 2009 23:54:14
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <iostream>
#include <math.h>
int main()
{
	int n,t,g;
	float i,j;
	freopen("cifra.in","r",stdin);
	freopen("cifra.out","w",stdout);
	std::cin>>t;
	n=0;
	do
	{
		std::cin>>n;
		{
			g=0;
			i=1;
			while (i<=n)
			{
				
				g=g+pow(i,i);
				i++;
			}
			std::cout<<g%10<<" "<<std::endl;
		}
	}
	while (n<t);
}