杭电acm1406 请问我到底错在哪里?谢谢! http://acm.hdu.edu.cn/showproblem.php?pid=1406
#include<stdio.h>intmain(){inti,j,m,n,k,s,num1,num2;scanf("%d",&n);for(i=1;i<=n;i++){...
#include<stdio.h>
int main()
{
int i,j,m,n,k,s,num1,num2;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
m=0;
scanf("%d %d",&num1,&num2);
for(j=num1; j<=num2; j++)
{
s=0;
for(k=1; k<num1; k++)
{
if(num1%k==0)
s+=k;
}
if(num1==s)
m+=1;
}
printf("%d\n",m);
}
} 展开
int main()
{
int i,j,m,n,k,s,num1,num2;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
m=0;
scanf("%d %d",&num1,&num2);
for(j=num1; j<=num2; j++)
{
s=0;
for(k=1; k<num1; k++)
{
if(num1%k==0)
s+=k;
}
if(num1==s)
m+=1;
}
printf("%d\n",m);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询