求教循環(huán)各位數(shù)
int num, sd, td, hd; ? ?//循環(huán)所有三位數(shù) ? ?for(sd=0,td=0,hd=1;sd<10&&td<10&&hd<10 ; sd++ ,td++,hd++) ? ?{ ? ? ? ?num=100*hd+10+td+sd; ? ? ? ?if(num==hd*hd*hd+td*td*td+sd*sd*sd ? ? ? ? ? ? ? ? ) ? ? ? ?{ ? ? ? ? ? ?printf("水仙花數(shù)字:%d\n", num); ? ? ? ? ? ?} ? ?} 這個錯在哪?
2015-06-14
td ?后有個括號。。。
2015-05-05