错在哪呢?
public class exam4 {
public static void main(String[] args) {
int maxvalue;
maxvalue = max(123, 22, 122);
System.out.println("三个数的最大值是" + maxvalue);
}
public static int max(int x, int y, int z) {
int temp, maxvalue;
temp = (x > y) ? x : y;
maxvalue = (temp > z) ? temp : z;
return maxvalue;
}
}
------解决方案--------------------没错啊,哪有什么错呢?