Cod sursa(job #3322546)
| Utilizator | Data | 14 noiembrie 2025 18:10:39 | |
|---|---|---|---|
| Problema | Suma divizorilor | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<fstream>
using namespace std;
ifstream cin("sumdiv.in");
ofstream cout("sumdiv.in");
int sumdiv(int n,int d=1)
{
if(d<=n)
{
if(n%d==0)
{
return d+sumdiv(n,d+1);
}
else return sumdiv(n,d+1);
}
else
{
return 0;
}
}
long long a,b,s,i,x;
int main()
{
cin>>a>>b;
x=a;
for(i=1;i<b;i++)
{
a=a*x%9901;
}
cout<<sumdiv(a);
return 0;
}
