Cod sursa(job #1930342)
| Utilizator | Data | 18 martie 2017 19:25:41 | |
|---|---|---|---|
| Problema | Cifra | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<string.h>
#include<fstream>
#include<math.h>
#include<stdlib.h>
using namespace std;
int main()
{ifstream f("cifra.in");
ofstream g("cifra.out");
int s=0, i, j;
char n[100], p[100];
long long val, val2;
f.get(p,100);
val2=atoi(p);
for(i=1;i<=val2;i++){
f.get(n,100);
val=atoi(n);
for(j=1;j<=val;j++)s+=pow(j,j);
g<<(s%10)<<endl;
}
f.close();
g.close();
return 0;
}
