// 08B.cpp : Defines the entry point for the console application.
//email:244910075@qq.com
//function:水仙花数判定
#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
int i=0,m,array[100];
scanf_s("%d",&array[0]);
while(array[i++])
{
scanf_s("%d",&array[i]);
}
for(m=0;m<i-1;m++)
{
if(array[m]>99&&array[m]<1000)
{
int digit,ten,hunder;
hunder=array[m]/100;
ten=array[m]%100/10;
digit=array[m]%10;
if(array[m]==hunder*hunder*hunder+ten*ten*ten+digit*digit*digit)
printf("yes\n");
else
printf("no\n");
}
else
printf("no\n");
}
system("pause");
return 0;
}
//email:244910075@qq.com
//function:水仙花数判定
#include "stdafx.h"
#include<stdio.h>
#include<stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
int i=0,m,array[100];
scanf_s("%d",&array[0]);
while(array[i++])
{
scanf_s("%d",&array[i]);
}
for(m=0;m<i-1;m++)
{
if(array[m]>99&&array[m]<1000)
{
int digit,ten,hunder;
hunder=array[m]/100;
ten=array[m]%100/10;
digit=array[m]%10;
if(array[m]==hunder*hunder*hunder+ten*ten*ten+digit*digit*digit)
printf("yes\n");
else
printf("no\n");
}
else
printf("no\n");
}
system("pause");
return 0;
}