发帖代码总比发图别人调试上来更加方便~
当然我还是看图说话了~
sd=num/10;
然后笑了~
#include<stdio.h> int main() { int num, sd, td, hd; for (num = 100; num < 1000; num++) { hd = num / 100; td = num / 10 %10; sd = num % 10; if (num == hd*hd*hd + td*td*td + sd*sd*sd) { printf("水仙花数字: %d\n", num); } } return 0; }
[此贴子已经被作者于2017-11-5 12:55编辑过]