Cod sursa(job #399056)
Utilizator | butnaras andrei andrei.royal777 | Data | 19 februarie 2010 19:54:58 |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<math.h>
main(){ clrscr();
ifstream f("cifra.in",ios::in);
ofstream g("cifra.out",ios::out);
long int i,a,s,k,j;
long double n;
f>>n; cout<<n;
for(i=1;i<=n;i++)
{ f>>a; s=0;
for(j=1;j<=a;j++)
s=s+pow(j,j);
k=s%10;
g<<k<<endl;}
getch();
}