AtCoder Beginner Contest 171 A - αlphabet
阿新 • • 發佈:2020-07-15
Time Limit: 2 sec / Memory Limit: 1024 MB
Score :100points
Problem Statement
An uppercase or lowercase English letterααwill be given as input. Ifααis uppercase, printA
; if it is lowercase, printa
.
Constraints
- ααis an uppercase (
A
-Z
) or lowercase (a
z
) English letter.
Input
Input is given from Standard Input in the following format:
αα
Output
Ifααis uppercase, printA
; if it is lowercase, printa
.
Sample Input 1Copy
CopyB
Sample Output 1Copy
CopyA
B
is uppercase, so we should printA
.
Sample Input 2Copy
Copy
a
Sample Output 2Copy
Copya
a
is lowercase, so we should printa
.
題意:輸入一個字元,如果是大寫字元輸出 'A',如果是小寫字元輸出 'a'
程式碼如下:
#include<cstdio> using namespace std; int main(void) { char c; while(~scanf("%c",&c)) { getchar(); if(c>='a'&&c<='z') puts("a"); else //if(c>='A'&&c<) puts("A"); } return 0; }