全部博文(930)
分类: LINUX
2009-08-17 14:39:17
|
chinaunix网友2009-08-21 11:08:11
int num = 1; int result = 0; StringBuffer sbuf = new StringBuffer(10240); for (int x = 1; x <= 1000 - 7; x++) { for (int y = 1; y <= (1000 - 6) / 2; y++) { for (int z = 1; z <= (1000 - 3) / 5; z++) { result = x + y * 2 + 5 * z; if (result == 1000) { String s = (num) + ": x=" + x + ";y=" + y + ";z=" + z+";result="+result; sbuf.append(s).append("\r"); num++; } } } }