Cod sursa(job #23116)
| Utilizator | Data | 28 februarie 2007 09:51:04 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream.h>
#include<math.h>
#include<fstream.h>
int n,i,j,k;
int main(){
fstream f("cifra.in",ios::in);
fstream g("cifra.out",ios::out);
f>>n;
while(f>>n)
{
j=1;
for(k=2;k<=n;k++)
{
j=j+pow(k%10,k%4);
j=j%10;
}
g<<j<<endl;
}
f.close();
g.close();
}
