我的程序有問題嗎?我感覺和別人一樣啊,為什么我輸出的是101.102--999
#include<stdio.h>
int main()
{
??? int num,sd,td,hd;
??? for(num=100;num<1000;num++)
??? {
??????? hd=num/100;
??????? td=num%100/10;
??????? sd=num%10;
??????? if(num==hd*hd*hd+td*td*td+sd*sd*sd);
??????? {
??????????? printf("水仙花數字:%d\n",num);
??????? }
??? }
??? return 0;
}
2019-02-19
?if(num==hd*hd*hd+td*td*td+sd*sd*sd);這個不需要“;”變成?if(num==hd*hd*hd+td*td*td+sd*sd*sd)