Cod sursa(job #1881763)
Utilizator | Data | 16 februarie 2017 18:40:21 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
ifstream f("sumdiv.in");
ofstream g("sumdiv.out");
long long a,b;
int s=1;
int main()
{
f>>a>>b;
int c=pow(a,b);
s+=c;
for(int i=2;i<=c/2;i++)
if(c%i==0)
s+=i;
g<<s;
return 0;
}