Cod sursa(job #1245888)
Utilizator | Data | 20 octombrie 2014 10:31:06 | |
---|---|---|---|
Problema | Suma si numarul divizorilor | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.37 kb |
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("ssnd.in");
ofstream g("ssnd.out");
int t,n,i,nrd,s,d;
int main()
{
f>>t;
for (i=1;i<=t;i++)
{
f>>n;nrd=2;s=1+n;
for (d=2;d<=sqrt(n);d++) if (n%d==0)
{
nrd++;
s=s+d;
}
g<<nrd<<" "<<s%9973<<'\n';
}
return 0;
}