๐ Day 14 โ Teacher's Day Challenge | Word Capitalization


๐๏ธ Date: August 07, 2025
๐งฉ Platform: Codeforces
๐ข Problems Solved Today: 1
๐ฏ Focus Topic: String Manipulation
๐ Table of Contents
Daily Summary
๐งฉ Problem 1 โ Word Capitalization
๐ Difficulty: Easy
๐ง Concepts: String Manipulation
๐ Problem Statement (Summary):
Capitalize the first letter of the input word. All other letters must remain unchanged.
๐ข Input Format:
A single word (string) containing only English lowercase and/or uppercase letters.
๐งพ Output Format:
The word with its first character capitalized.
๐ Example 1:
Input:ApPLe
Output:ApPLe
๐ Example 2:
Input:konjac
Output:Konjac
๐ก Approach:
Take input string.
Convert the first character to uppercase using
toupper()
.Print the modified string.
๐งช Code (C++):
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
cin >> str;
str[0] = toupper(str[0]);
cout << str;
return 0;
}
๐ธ Submission Screenshot:
โ Key Takeaways:
You can modify characters directly in a string using indexing.
toupper()
function is useful for case conversion.Basic string manipulation problems help build fundamentals.
๐ Daily Summary
Metric | Value |
Problems Solved | 1 |
Topics Covered | String Manipulation |
Tools Used | C++ |
Next Focus | Continue String Problems (Edge Cases, Word-based) |
Day | 14 / 43 |
๐ท๏ธ Tags:#codeforces #strings #beginner #cpp #dsa #43DaysChallenge
Subscribe to my newsletter
Read articles from Tanishi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
