Re: [問卦] 用if else敘述反對死刑但這個必須死

看板Gossiping作者 (orz)時間1年前 (2022/08/23 15:44), 編輯推噓0(003)
留言3則, 1人參與, 1年前最新討論串6/7 (看更多)
※ 引述 《applebg (Noble Wolf)》 之銘言: 你要不要補一下字數 : ※ 引述《pchion2002 (阿我就怕被罵阿)》之銘言: : : 各位大師下午好 : : 昨天兩名警察領了盒飯 : : 造就了有金句產生 : : 從程式語言來看下面這句話 : : 「我反對死刑但這一定要判死」 : : 判斷式要怎麼寫才能成立? :   : //judges do not sentence people to death : bool death_sentence = False; :   : //assume that no policemen die : bool kill_policemen = False; :   : //if no policemen die, the judge would say the following : while(!death_sentence){ : printf("judge: be a good person, you shall be pardoned"); : //if a policeman dies, the judge will stop pardoning people : //and sentence people to death : if(kill_policemen == True){ : printf("May God have mercy upon your soul, : because I won't!"); : death_sentence = True; : break; : } :   : } :   少了最後一段 while(death_sentence && 0){ executePenalty(); } 原句是:我反對判死刑但這一定要判死刑 宣判死刑跟執行死刑是兩回事 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.137.131.81 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Gossiping/M.1661240648.A.FAA.html

08/23 17:23, 1年前 , 1F
本來就是殺人償命executePenalty
08/23 17:23, 1F

08/23 17:24, 1年前 , 2F
說的好
08/23 17:24, 2F

08/23 19:23, 1年前 , 3F
改executeDeathPenalty?
08/23 19:23, 3F
文章代碼(AID): #1Z18L8-g (Gossiping)
討論串 (同標題文章)
文章代碼(AID): #1Z18L8-g (Gossiping)