Cod sursa(job #1852368)
Utilizator | Data | 20 ianuarie 2017 19:00:30 | |
---|---|---|---|
Problema | Suma si numarul divizorilor | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <fstream>
using namespace std;
ifstream f1("ssnd.in");
ofstream f2("ssnd.out");
int main()
{ int x,i,cx,j,ct,s;
long long n;
f1>>n;
for(i=1;i<=n;i++)
{f1>>x;
ct=0; s=0;
for(j=1;j*j<=x;j++)
if(x%j==0)
{s=s+j; ct++;
if(x/j!=j)
{s=s+x/j; ct++;}
}
f2<<ct<<" "<<s%9973<<"\n";
}
return 0;
}