Cod sursa(job #1679414)
Utilizator | Data | 7 aprilie 2016 22:29:20 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
int main()
{
double a,b,x;
int s=1,d;
f>>a>>b;
x=pow(a,b);
s=s+x;
for(d=2; d<=x/2; d++)
if((int)x%d==0)
s=s+d;
g<<s%9901;
return 0;
}