#8234: (JAVA) no if 做法


tripleH (tripleH)



int w; //體重
        .............
............. 
int d = Math.min( Math.max((w-51),0) , (w-50) );    
System.out.println(50+d);


分享一下我的寫法
有大大有其他不使用if的寫法嗎?? 
#8303: Re:(JAVA) no if 做法


tomoyaken14 (歐練)



int w; //體重
        .............
............. 
int d = Math.min( Math.max((w-51),0) , (w-50) );    
System.out.println(50+d);


分享一下我的寫法
有大大有其他不使用if的寫法嗎?? 

三元運算子