//输出1000以内的水仙花数
#include <stdio.h>
#include <math.h>
int main(){
    int a,b,c,s,i;
    printf("水仙花数如下:\n");
    for(i=100;i<=999;i++){
        a=i/100;
        b=(i/10)%10; 
        c=i%10;
        if(i==a*a*a+b*b*b+c*c*c) printf("%d\n",i);
    }
    return 0;
} 

收录于文章《885程序设计考点狂背总目录中

相关文章:

  • 2021-06-02
  • 2021-09-11
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
猜你喜欢
  • 2021-05-29
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2021-05-03
相关资源
相似解决方案