Pagini recente » Istoria paginii runda/speed/clasament | Cod sursa (job #1391559) | Cod sursa (job #1000214) | Cod sursa (job #650220) | Cod sursa (job #1277559)
#include <fstream>
#include <cmath>>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int t,v[10],p[10];
int main()
{
int n,k=0,i,s=0,l=0,h;
f>>t;
for(n=1;n<=t;n++) {f>>v[n]; k++;}
while(k)
{
for(i=1;i<=v[k];i++)
s=s+pow(i,i); l++;
p[l]=s; k--; s=0;
}
for(h=t;h>=1;h--) g<<p[h]%10<<'\n';
f.close();
g.close();
return 0;
}