Cod sursa(job #757954)
Utilizator | Data | 13 iunie 2012 20:59:32 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
int x=1,A,B,S=0,d;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
f>>A>>B;
while(B!=0){x=x*A;B--;}
for(d=1;d<=x;d++)
if (x%d==0)S=S+d;
S=S%9901;
g<<S;
return 0;
}