Cod sursa(job #495288)
Utilizator | Data | 24 octombrie 2010 18:02:01 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 0 |
Compilator | cpp | Status | done |
Runda | noobz_aa | Marime | 0.28 kb |
#include<iostream.h>
#include<fstream.h>
#include<math.h>
ifstream f("permutari.in");
ofstream g("permutari.out");
int main()
{
int a,b,k=1,c,d;
float s=0;
f >>a>>b;
f.close();
c=pow(a,b);
while (c+1>k)
{
if (c%k==0)
s=s+k;
k++;
}
g<<s;
g.close();
}