1. 程式人生 > 實用技巧 >AtCoder Beginner Contest 171 A - αlphabet

AtCoder Beginner Contest 171 A - αlphabet

A - αlphabet


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

Copy
B

Sample Output 1Copy

Copy
A

Bis uppercase, so we should printA.


Sample Input 2Copy

Copy
a

Sample Output 2Copy

Copy
a

ais 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; }