-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path281A_Word_Capitalization.cpp
More file actions
50 lines (42 loc) · 1009 Bytes
/
281A_Word_Capitalization.cpp
File metadata and controls
50 lines (42 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
A. Word Capitalization
time limit per test2 seconds
memory limit per test256 megabytes
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
*/
#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
int main()
{
string s;
cin>>s;
int l = s.length();
char ch;
ch=s[0];
if(islower(ch))
{
s[0]=toupper(ch);
cout<<s;
}
else
cout<<s;
}