Cod sursa(job #307383)
Utilizator | Data | 24 aprilie 2009 01:56:28 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<fstream.h>
#include<math.h>
int main()
{
int a,b,s,d,x;
ifstream in("sumdiv.in");
ofstream out("sumdiv.out");
in >> a;
in >> b;
s = 0;
x = pow(a,b);
for (d=1; d<=x; d++)
if ((x % d) == 0)
s = s + d;
out << s % 9901;
}