视频里的IF语句求两个数的最大值,我求三个数~~
class Bb {
public static void main(String[] args) {
int x = 100;
int y = 40;
int z = 30;
if(x > y) {
if(x>z){
System.out.println("最大值为x = 100");
}else {
System.out.println("最大值为z = 30");
}
}else {
if(y>z){
System.out.println("最大值为y = 40");
}else {
System.out.println("最大值为z = 30");
}
}
}
}
|
|