文章目录
一、Word Capitalization
总结
一、Word Capitalization
本题链接:Word Capitalization
题目:
A. Word Capitalization
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
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.
Input
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
Output the given word after capitalization.
Examples
input
ApPLe
output
ApPLe
input
konjac
output
Konjac
本博客给出本题截图:
题意:首字母变大写,其余字母不变
AC代码
#include <iostream> using namespace std; const int N = 1010; char s[N]; int main() { cin >> s; if (s[0] >= 'a' && s[0] <= 'z') s[0] = s[0] - 'a' + 'A'; cout << s; return 0; }
总结
Capitalization
大写
capital
大写字母
capitalize
让首字母大写
水题,不解释