Albert and Bernard just become friends with Cheryl, and they want to know when her birthday is. Cheryl gives them a list of 10 possible dates.
May 15, May 16, May 19,
June 17, June 18,
July 14, July 16,
August 14, August 15, August 17
Cheryl then tells Albert and Bernard separately the month and the day of her birthday respectively.
Albert: I don't know when Cheryl's birthday is, but I know that Bernard does not know too.
Bernard: At first I don't know when Cheryl's birthday is, but I know now.
Albert: Then I also know when Cheryl's birthday is.
So when is Cheryl's birthday?
這是新加坡一題中學生數學考題,需要靠邏輯推理解題,大家想想看。
緊急筆記:js控制動畫(AI回答)
-
在 JavaScript 中使用函數遞歸來控制動畫,最常見且推薦的方式是搭配 requestAnimationFrame
來實現,而不是用純粹的同步遞歸(因為同步遞歸會造成呼叫堆疊爆炸)。 以下是幾種常見的寫法,從簡單到實用,逐步說明: 1.
最經典寫法(推薦大多數情況使用) let isRunning = ...
1 週前

July16
回覆刪除第一句排除5、6月
第二句排除14、18、19號
第一輪交談過後,算算只剩下7.16,8.15,8.17三天
第三句過後,結果是二人皆知,故排除8月,因其有兩天,如只知道月份則不能確定是哪天。
(這題有不少變式,有些還加上了文字遊戲,很有意思。)
正解,這題目推理有其難度,能答得出來不簡單。
回覆刪除第三句可以改成:But I still don't know.
回覆刪除第四句:You should know that later.
第五句:Thanks, you are very kind.
嗯,這個改編不錯,讓我記下來
刪除Albert: But I still don't know.
Bernard: You should know that later.
Albert: Thanks, you are very kind.