猿问

C语言编辑找错(水仙花数)

#include <stdio.h>
int main()
{
     int num1, sd, td, hd ,count=0,x,y;
     num1>=100&&x<1000;
     y>=100&&y<1000;
     scanf("%d%d",&x,&y);
     for(num1=x;num1<=y;num1++)
    {
              hd =num1/100;
              td =(num1%100)/10;
              sd =num1%10;
        if(num1==hd*hd*hd+td*td*td+sd*sd*sd)
        {
   count++ ;
  printf("%d ",num1);
        }
    }
        if(count==0)
        printf("no");
       
    return 0;   
}

qq_微笑_121
浏览 1087回答 0
0回答
随时随地看视频慕课网APP
我要回答