已知 XYZ+YZZ=532,其中,X、Y、Z 为数字,编程求出 X、Y 和 Z 的值。
public class day7extra2 {
public static void main(String[] args) {
int x,y,z;
for(x=1;x<=9;x++)
{
for(y=1;y<=9;y++)
{
for(z=1;z<=9;z++)
{
if(100*x+110*y+12*z==532)
{
System.out.println("x="+x);
System.out.println("y="+y);
System.out.println("z="+z);
}
else
{
continue;
}
}
}
}
}
}