Cod sursa(job #664377)
Utilizator | Data | 20 ianuarie 2012 00:07:36 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<iostream>
#include<fstream>
using namespace std;
int main()
{int i,n,y=1,s=0,z,p;
ifstream f1("cifra.in");
ofstream f1("cifra.out");
f1>>n;
while(y<=n)
{z=y;p=1;
while(z!=0)
{p=p*y;
z--;}
s=s+p;
y++;}
f2<<s%10;
f1.close();
f2.close();
return 0;}