--- tags: DICE C --- 9-4 英文大小寫 === > [name=CHAWTeam] 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) 題目 --- ```! 輸入一個字元, 請判斷這個字元是英文大寫還是英文小寫,或是根本不是英文字母, 分別輸出「大寫」、「小寫」或「都不是」。 輸入範例1: A 輸出範例1: 大寫 輸入範例2: a 輸出範例2: 小寫 輸入範例3: ! 輸出範例3: 都不是 ``` 程式碼 --- ```c= #include <stdio.h> int main() { char a; scanf("%c", &a); if ((a >= 'A') && (a <= 'Z')) { printf("大寫"); } else if ((a >= 'a') && (a <= 'z')) { printf("小寫"); } else { printf("都不是"); } return 0; } ``` 輸出 --- ```! A 大寫 a 小寫 ! 都不是 ``` --- [查看我們在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-9-4" 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