1. 程式人生 > >演算法訓練 大小寫判斷

演算法訓練 大小寫判斷

問題描述

  給定一個英文字母判斷這個字母是大寫還是小寫。

輸入格式

  輸入只包含一個英文字母c。

輸出格式

  如果c是大寫字母,輸出“upper”,否則輸出“lower”。

樣例輸入

x

樣例輸出

lower

樣例輸入

B

樣例輸出

upper


#include<iostream>
#include<cstdlib>
#include<string>
using namespace std;

int main()
{
    string s;

    cin >> s;

    if(isupper(s[0]))
        cout << "upper" << endl;
    else cout << "lower"  << endl;
    return 0;
}