Cod sursa(job #2332697)
Utilizator | Data | 31 ianuarie 2019 00:47:59 | |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <iostream>
#include <cmath>
using namespace std;
ifstream fin("cifra.in");
ofstream fout("cifra.out");
int n, a[30000];
int main()
{
int s, aux;
fin>>n;
for(int i = 0; i < n; i++)
{
s = 0;
fin>>a[i];
for(int j = 1; j <= a[i]; j++)
{
aux = 1;
for(int k = 1; k <= j; k++)
aux *= j, cout<<aux<<" ";
s += aux;
}
fout<<s%10<<"\n";
}
return 0;
}