1 回答

慕標(biāo)琳琳
TA貢獻(xiàn)1830條經(jīng)驗(yàn) 獲得超9個(gè)贊
public?static?void?main(String[]?args){
????int?a=11,b=12,c=10;
????method1(a,b,c);
????method2(a,b,c);
}
private?static?void?method1(int?a,int?b,int?c){
????int?max=a;
????if(max<b)
????????max=b;
????if?(max<c)
????????max=c;
????System.out.println(max);
}
private?static?void?method2(int?a,int?b,int?c){
????int?max=a?>?b???a?:?(b>c???b?:?c);
????System.out.println(max);
}
添加回答
舉報(bào)
0/150
提交
取消