水的一米的水仙花

#include<iostream>
#include<math.h>
using namespace std;
int main()
{   int n,hundred,ten,digit,sum;
	while(1)
	{
		cin>>n;
		if(n==0)
			break;
		else
		{
			hundred=n/100;
			ten=(n-100*hundred)/10;
			digit=(n-100*hundred-10*ten);
			sum=pow(hundred,3)+pow(ten,3)+pow(digit,3);
			if(sum==n)
				cout<<"Yes"<<endl;
			else
				cout<<"No"<<endl;

		}




	}



}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章