|
// Java三个正整数求最大值——多分支
|
|
package xiangmu;
|
|
|
|
public class Ceshi {
|
|
public static void main(String args[]) {
|
|
int a = 3;
|
|
int b = 5;
|
|
int c = 4;
|
|
if(a >= b && a >= c) {
|
|
dayin("最大值是:" + a);
|
|
}else if(b >= c) {
|
|
dayin("最大值是:" + b);
|
|
}else {
|
|
dayin("最大值是:" + c);
|
|
}
|
|
}
|
|
public static void dayin(String zifuchuan) {
|
|
System.out.println(zifuchuan);
|
|
}
|
|
}
|