--- tags: DICE C --- 10-2 猴子上學 === > [name=CHAWTeam] 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) 題目 --- ```! 寫一個程式,輸入一個整數: 如果, 整數是11,印星期一猴子穿新衣 整數是22,印星期二猴子肚子餓 整數是33,印星期三猴子去爬山 整數是44,印星期四猴子看電視 整數是55,印星期五猴子去跳舞 其餘,我不知到啦 輸入範例: 11 輸出範例: 星期一猴子穿新衣 ``` 程式碼 --- ```c= #include <stdio.h> int main() { int x; scanf("%d", &x); if (x == 11) printf("星期一猴子穿新衣"); else if (x == 22) printf("星期二猴子肚子餓"); else if (x == 33) printf("星期三猴子去爬山"); else if (x == 44) printf("星期四猴子看電視"); else if (x == 55) printf("星期五猴子去跳舞"); else printf("我不知到啦"); return 0; } ``` 輸出 --- ```! 11 星期一猴子穿新衣 ``` --- [查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam) 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) --- {%hackmd Iiu5mOixR7yWkPHKCkabBg %} <iframe class="LikeCoin" height="235" src="https://button.like.co/in/embed/chawteam/button?referrer=https://hackmd.io/@CHAWTeam/DiceC-10-2" width="100%"></iframe> --- {%hackmd i1nMRrZcTFmTvoF897K9zg %}
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up