→ tkcn:這是作業? 03/14 17:23
→ kevin771012:online judge看到的一題....想半天想不出來= = 03/14 17:24
→ kevin771012:有看到microsoft自家軟體works的取代方案 03/14 17:33
→ kevin771012:(判斷式)*(true結果) + (~判斷式)*(false結果) 03/14 17:37
→ kevin771012:可是boolean與int沒辦法做運算 所以就完全不知道了 03/14 17:39
→ chrisQQ:System.out.println(input - (input/51)); 03/14 19:02
→ chrisQQ:小於 102 可以這樣用 XD 03/14 19:03
→ tkcn:樓上可以改進成這樣 Math.min(input/51, 1) 03/14 19:34
→ tkcn:另外用 short-circuit operator 也可以做出 if 的效果 03/14 19:36
推 chchwy:問題是java的short-circuit限制大的多了XDDD 03/14 19:37
→ kevin771012:shor-circuit 是~? 03/14 19:49
→ tkcn:google it! 03/14 19:52
→ kevin771012:不就是邏輯判斷子嗎@@? 03/14 19:55
→ bleed1979:那一題,我想send。 03/14 21:51
推 tigertiger:input - (input/51) + (input/102) + (input/153) 03/15 00:17
→ tigertiger:可以到254..要更高就再加 03/15 00:20
→ TonyQ:it's better to use if directly. Not need to be so tricky 03/15 03:20