Cod sursa(job #330827)
Utilizator | Data | 11 iulie 2009 17:13:01 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream>
#include <math.h>
std::ifstream in("sumdiv.in");
std::ofstream out("sumdiv.out");
int main ()
{
long d,a;
long b;
long long s=0;
in>>a>>b;
a=pow(a,b);
for(d=1;d<a+1;d++)
{
if(a%d==0)
s+=d;
}
out<<s%9901<<"\n";
in.close ();
out.close ();
return 0;
}