/*
采用3重for循环,代码更容易理解些,元方你怎么看?
*/
class Test
{
Test()
{
for (int i = 0;i<30 ;i++ )
{
for (int j = 0;j<30 ;j++ )
{
for (int k = 0;k<30 ;k++ )
{
if (50==i*3+j*2+k*1)
{
System.out.println("i="+i+",j="+j+",k="+k);
}
}
}
}
}
}
class HeiMa
{
public static void main(String []args)
{
Test t = new Test();
}
} |