Cod sursa(job #77170)

Utilizator tot_zeuIulean Sebi tot_zeu Data 13 august 2007 15:21:39
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <fstream>
using namespace std;
int main()
{ ifstream fi("cifra.in");
  ofstream fo("cifra.out");
  int t,i,n,k,a;
  n=0;
  fi >> t;
  k=1;
while (k<=t)
{ a=1;
      for (i=0;i<k;i++)
       a = a*k;
          n = n + a;
    fo << n%10;
  k++;
} 
fi.close();
fo.close();
return 0;

}