๐Ÿ“˜ Day 14 โ€“ Teacher's Day Challenge | Word Capitalization

TanishiTanishi
2 min read

๐Ÿ—“๏ธ Date: August 07, 2025
๐Ÿงฉ Platform: Codeforces
๐Ÿ”ข Problems Solved Today: 1
๐ŸŽฏ Focus Topic: String Manipulation


๐Ÿ”— Table of Contents


๐Ÿงฉ 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

MetricValue
Problems Solved1
Topics CoveredString Manipulation
Tools UsedC++
Next FocusContinue String Problems (Edge Cases, Word-based)
Day14 / 43

๐Ÿท๏ธ Tags:
#codeforces #strings #beginner #cpp #dsa #43DaysChallenge

0
Subscribe to my newsletter

Read articles from Tanishi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tanishi
Tanishi