Cod sursa(job #688448)
Utilizator | Data | 23 februarie 2012 16:25:58 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<iostream>
#include<fstream>
int main(){
using namespace std;
fstream fin("cifra.in" , ios::in) , fout("cifra.out" , ios::out);
int n,t,i,s=0,j,p=1,k;
fin>>t;
for(i=1;i<=t;i++){
fin>>n;
for(j=1;j<=n;j++){
for(k=1;k<=j;k++){
p=p*j;}
s=s+p;
p=1;}
fout<<s%10<<endl;
s=0;}
return 0 ;
}