narcissus

public class narcissus
{
	public static void main(String args[])
	{
		long u=0,t=0,h=0,y=0,k=0;
		for(long x=100; x<1000;x++)
		{
			u=x%10;
			t=x/10%10;
			h=x/100%10;
			//k=x/1000%10;
			//System.out.printf("%d\n",x);
			y=(u*u*u)+(t*t*t)+(h*h*h);
			if(y==x) System.out.printf("%d\n",y);
		}
	}
}


posted on 2017-10-27 10:46  MACHINE_001  阅读(76)  评论(0编辑  收藏  举报

导航