题目:
Capitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.
Note, that during capitalization all the letters except the first one remains unchanged.
输入:
A single line contains a non-empty word. This word consists of lowercase and uppercase English letters. The length of the word will not exceed 103.
输出:
Output the given word after capitalization.
Examples
input
konjac
output
Konjac
代码:
#include <iostream>
using namespace std;
string s;
int main() {
cin >> s;
if (s[0] >= 'A' && s[0] <= 'Z')
cout << s << endl;
else {
s[0] -= ('a' - 'A');
cout << s << endl;
}
return 0;
}