Cod sursa(job #1126741)

Utilizator tomoiagatudortomoiaga tudor tomoiagatudor Data 27 februarie 2014 09:34:51
Problema Suma divizorilor Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;

int main()
{
    int a,b,k,s=0 ,i,p;
    ifstream f ("sumdiv.in");
    ofstream g ("sumdiv.out");
    f>>a;
    f>>b;
    k=pow(a,b);
    for (i=1;i<=k;i++)
        if(k%i==0)
        s=s+i;
        p=s % 9901;
    g<<p<<" ";
    f.close ();
    g.close ();
}