Cod sursa(job #898563)

Utilizator robertc1Robert Ciobotaru robertc1 Data 28 februarie 2013 10:42:00
Problema Suma si numarul divizorilor Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.43 kb
#include <fstream>
#define IN "ssnd.in"
#define OUT "ssnd.out"
using namespace std;

ifstream fin(IN);
ofstream fout(OUT);

int n;
int main()
{
    long i,s,a,j,cate;
    fin>>n;
    for(i=1;i<=n;i++)
    {
        s=1;
        cate=1;
        fin>>a;
        //a=a/2;
        for(j=2;j<=a/2;j++)
        if(a%j==0) {cate++;s=s+j;}
        s=(s+a)%9973;
        fout<<cate+1<<' '<<s<<'\n';
    }
    return 0;
}