Cod sursa(job #893051)
Utilizator | Data | 26 februarie 2013 12:47:19 | |
---|---|---|---|
Problema | Suma si numarul divizorilor | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include<stdio.h>
int a,x,y,t,c,s;
int main()
{
freopen("ssnd.in","r",stdin);
freopen("ssnd.out","w",stdout);
scanf("%d",&t);
x=1;
while(x<=t)
{
scanf("%d",&a);
s=0;
c=0;
y=1;
while(y<=a)
{
if(a%y==0)
{
s=s+y;
c=c+1;
}
y=y+1;
}
printf("%d ",c);
printf("%d",s);
printf("\n");
x=x+1;
}
fclose(stdin);
fclose(stdout);
return 0;
}