Cod sursa(job #719515)
Utilizator | Data | 21 martie 2012 20:48:24 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.25 kb |
#include <fstream>
#include <math.h>
using namespace std;
int main()
{int n,y,i,j;
int s=0;
ifstream f("cifra.in");
ofstream g("cifra.out");
f>>n;
for(i=1;i<=n;i++)
{ f>>j;
for(y=1;y<=j;y++)
s=s+pow(y, y);
g<<s<<endl;
s=0;
}}