C语言实现的水仙花数

#include <stdio.h>
void main(){

  

  int ge,shi,bai;
      for (int i =100; i < 1000; i++)
     {
          bai=i/100;
          shi=i%100/10;
          ge=i%100%10;
          if(bai*bai*bai+shi*shi*shi+ge*ge*ge==i)
           printf("%d ",i);
    }

    printf(" ");

}  

原文地址:https://www.cnblogs.com/duanchen/p/4422482.html