Cod sursa(job #23670)
| Utilizator | Data | 1 martie 2007 10:13:37 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.18 kb |
#include <fstream.h>
#include <math.h>
int n,s=0,i;
int main()
{
ifstream f("cifra.in");
ofstream g("cifra.out");
f>>n; f.close();
for (i=1;i<=n;i++)
{s=pow(i,i)+s;}
g<<s%10;}
