Cod sursa(job #2035491)

Utilizator stahlhelmVirtejaru Mihai stahlhelm Data 9 octombrie 2017 15:48:23
Problema Suma divizorilor Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.31 kb
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("sumdiv.in");
ofstream c("sumdiv.out");
int sumadiv(int x,int y)
{ int S=0,i,z;
z=pow(x,y);
for(i=2;i<=z/2;i++)
{if(z%i==0)
    S=S+i;
}
c<<S%9901;
}

int main()
{
    int A,B;
    f>>A>>B;
    sumadiv(A,B);
}