Cod sursa(job #923134)

Utilizator GrandmasterSoucup Bogdan Grandmaster Data 23 martie 2013 11:53:32
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream>
#include<cmath>
using namespace std;
int main()
{
	int n,i,s,j,Suma,Produs=0;
	ifstream g("cifra.in");
	ofstream f("cifra.out");
	g>>n;
	for(i=1; i<=n; i++)
	{
		g>>s;
		Suma=0;
		for(j=1; j<=s; j++)
		{
		Produs=powf(j,j);
		Suma=Suma+Produs;
		}
		f<<Suma%10<<endl;
	}
}