zerojudge d068. 該減肥了

 zerojudge d068. 該減肥了

解法大全:

1.判斷式
2.三元運算子
3.布林比較:

    w=w-(w>50);
    //same as w-=(w>50)
    //not w=w-w>50;
    //"-" has  higher priority to">" , this will always get 0

    //more complex
    w=(w<=50)*w+(w>50)*(w-1);

Comments

Popular posts from this blog

zerojudge c561. Bert 愛搗蛋

zerojudge d122. Oh! My Zero!!