Cod sursa(job #3207210)
Utilizator | Alexandru George Daniel Real_agd | Data | 25 februarie 2024 14:56:26 |
---|---|---|---|
Problema | Cifra | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main(){
int T, N, S=1, s=2, i, q, j;
ifstream cifra_in("cifra.in");
cifra_in>>T;;
ofstream cifra_out("cifra.out");
for(i=0; i<T; i++){
cifra_in>>N;
for(q=2; q<=N; q++){
for(j=1; j<q; j++){
s=(s*q)%10;
}
S=(S+s)%10;
s=q+1;
}
cifra_out<<S;
}
// moves the vector into the *out* file
return 0;
}