Cod sursa(job #874079)

Utilizator mikitaMihai Holban mikita Data 7 februarie 2013 21:25:24
Problema Cifra Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <fstream>

using namespace std;

int main()
{
  ifstream fin("cifra.in");
  ofstream fout("cifra.out");
  
   
 int n;
 fin>>n;
 int a;
 int calculare=0;
 int ceva = 1;
 for (int i=1;i<=n;i++)
     {
          fin>>a;
          for (int j=0;j<a;j++)
          {
             ceva *=a;
          }
           calculare += ceva;
            ceva=1;
          
           fout<<calculare%10 <<endl;
      }
      
      fin.close();
      fout.close();

    return 0;
}