(答案提示:3位数的水仙花数为153,370,371,407)#include<stdio.h>int flower(int n);int main (void){int n,m=1000;printf("1000以内的三位数的水仙花数:"); for(n=100;n<=m;n++) { if(flower(n)!=0) printf("%6d",n);} return 0;}int flower(int n){int a...
(答案提示:3位数的水仙花数为153,370,371,407) #include<stdio.h> int flower(int n); int main (void) { int n,m=1000; printf("1000以内的三位数的水仙花数:"); for(n=100;n<=m;n++) { if(flower(n)!=0) printf("%6d",n); } return 0; } int flower(int n) { int a,b,c; a...
if(c==2) break; } } printf("%d\n",n); }
include <stdio.h> #include <stdlib.h>void main() { int i,j,k,n,c=0; for(n=999;n>=100;n--) { i=n/100;/*分解出百位*/ j=n/10%10;/*分解出十位*/ k=n%10;/*分解出个位*/ if(n==i*i*i+j*j*j+k*k*k) { c++; if(c==2)...