水仙花数
Posted MintTremor
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了水仙花数相关的知识,希望对你有一定的参考价值。
#include<stdio.h>
int main()
{
int a, b, c, i;
while (1)
{
scanf("%d", &i);
if (i >= 100 && i<1000)
{
a = i / 100;
b = i / 10 % 10;
c = i % 10;
if (a*a*a + b*b*b + c*c*c == i)
printf("yes\n");
else
printf("no\n");
}
if (i==0)
{
break;
}
}
getchar();
}
以上是关于水仙花数的主要内容,如果未能解决你的问题,请参考以下文章