A - Word Capitalization
Problem Link: [Codeforces 281A##link##]
- [tab]
- C++
#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string s; cin >> s; putchar(toupper(s[0])); for(int i = 1; i < s.size();++i){ cout << s[i]; } }
- Python3
inp = input() up = inp[0].upper() rest = inp[1:] print(up+rest)
- JAVA
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String word = scanner.nextLine(); char capitalLetter = (char)(word.charAt(0) & 223); System.out.println(capitalLetter + word.substring(1)); } }