1 #include<stdio.h> 2 int main () 3 { 4 for ( int n = 100 ; n < 1000 ; n ++ ) 5 { 6 int g = n % 10 ; 7 int s = n / 10 % 10 ; 8 int b = n / 100 ; 9 if ( n == g * g * g + s * s * s + b * b * b ) 10 { 11 printf ("% d ",n); 12 } 13 } 14 15 printf ("\n"); 16 return 0; 17 }
//输出:
153 370 371 407 Program ended with exit code: 0
标签:10,13,int,153,printf,水仙花 From: https://www.cnblogs.com/wojiushidalao/p/16966946.html