NYOJ:水仙花数(C语言)

#include<stdio.h>
int main()
{
    int x;
    for(;;)
    {
        scanf("%d",&x);
        if(x==0)break;
        else
            {
                if (x == 153 || x == 370|| x == 371 || x == 407)
                printf("Yes\n");
                else
                printf("No\n");
            }
    }
    return 0;
}   //算出数据范围内所有的水仙花数,只有几个,所以就用了这种方法

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-06-11
  • 2021-07-17
  • 2022-12-23
相关资源
相似解决方案