class fivenarcissus
{
public static void main(String[] args)
{
int count=0;
for (int x=100;x<=999;x++)
{
int g=x%10,s=x/10%10,b=x/100%10;
if (x==(g*g*g)+(s*s*s)+(b*b*b))
{
count++;
System.out.println("x="+x);
}
System.out.println("count="+count);
}
}
} |
|