Cod sursa(job #798766)
Utilizator | Data | 17 octombrie 2012 10:12:11 | |
---|---|---|---|
Problema | Suma si numarul divizorilor | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include<fstream>
#define LL long long
using namespace std;
LL n;
int t;
int main()
{
ifstream f("ssnd.in");
ofstream g("ssnd.out");
f>>t;
for(int i = 1; i <= t; ++i)
{
f>>n;
LL nr = 0;
LL sum = 0;
for(LL j = 1; j <= n; ++j)
if(!(n % j))
{
nr++;
sum += j;
}
g<<nr<<' '<<sum<<'\n';
}
g.close();
return 0;
}