Cod sursa(job #800054)
| Utilizator | Data | 20 octombrie 2012 17:23:34 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
int main ()
{
ifstream f("cifra.in");
ofstream g("cifra.out");
unsigned int n , i, j;
unsigned long x , s ;
f>>n;
for (i=1;i<=n;i++)
{
f>>x;
s=0;
for (j=1;j<=x;j++)
{
s+=pow(j,j);
}
g<<s%10<<" ";
}
}
