Cod sursa(job #667750)

Utilizator MutescuMutescu Alexandru Mutescu Data 23 ianuarie 2012 18:14:13
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<fstream>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
unsigned short int T;
unsigned long int N,s=0,m=1;
int a[100],i,j,h;
int main(){
f>>T;
for(i=1;i<=T;i++){
	f>>N;
	for(j=1;j<=N;j++){
		for(h=1;h<=j;h++)
			m=m*j;
		s=s+m;
		m=1;
	}
	g<<s%10<<endl;
	s=0;
}
return 0;}