Cod sursa(job #674771)

Utilizator sleepaholicNeculaescu Theodor sleepaholic Data 6 februarie 2012 18:51:14
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include <math.h>
#include <fstream>
using namespace std;


int main()
{  int t,n,s=0;
   ofstream fout("cifra.out.txt");
   ifstream fin("cifra.in.txt");
  fin>>t;
  for (int i=1;i<=t;i++)
    {   s=0;
        fout<<endl;
        fin>>n;
    for (int j=1;j<=n;j++)
    s=s+(pow(j,j));
    fout<<s;
    }

    fout.close();
    fin.close();

    return 0;
}