C语言旅途之用for循环求水仙花数

Ⅰ、用for循环求水仙花数(1~1000): ①、//代码摘下直接可以运行 #include<stdio.h> int main() { printf(“the narcissus from 1 to 1000!\n”); int g,s,b; for(int n=100;n<1000;n++) { b=n/100; //百位数字没有问题 s=n/10%10;//十位数字没有问题 g=n%10;
相关文章
相关标签/搜索