Cod sursa(job #2514975)

Utilizator MerlinTheWizardMelvin Abibula MerlinTheWizard Data 27 decembrie 2019 14:56:02
Problema Cifra Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.35 kb
#include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
int suma,n,cifra,ori;
ifstream f("cifra.in");
ofstream g("cifra.out");
int main(){
f>>n;
for(int i=1;i<=n;i++){

    f>>cifra;
    suma=0;
        for(int j=1;j<=cifra;j++){
        ori=j%4;
        suma=suma+pow(j%10,ori);
        }
    g<<suma%10<<endl;
}
}