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;
相關文章
相關標籤/搜索