Cod sursa(job #1418193)

Utilizator Radu_FilipescuFilipescu Radu Radu_Filipescu Data 12 aprilie 2015 12:05:31
Problema Suma si numarul divizorilor Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.42 kb
#include <fstream>

using namespace std;

ifstream fin("ssnd.in");
ofstream fout("ssnd.out");

int main()
{
    int n,i,j,nr,nrdiv;
    unsigned long long suma;

    fin>>n;
    for(i=1; i<=n; i++)
     {
       fin>>nr;
       suma=nr;
       nrdiv=1;
       for(j=1; j<=nr/2; j++) if(nr%j==0) { nrdiv++; suma=suma+j; }
       fout<<nrdiv<<' '<<suma%9973<<'\n';
     }

fout.close();
    return 0;
}