A - 202<s>3</s> Editorial
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 100100 points
Problem Statement
You are given a string �S consisting of lowercase English letters and digits.
�S is guaranteed to end with 2023
.
Change the last character of �S to 4
and print the modified string.
Constraints
- �S is a string of length between 44 and 100100, inclusive, consisting of lowercase English letters and digits.
- �S ends with
2023
.
Input
The input is given from Standard Input in the following format:
�S
Output
Print the answer.
Sample Input 1Copy
Copy
hello2023
Sample Output 1Copy
Copy
hello2024
Changing the last character of hello2023
to 4
yields hello2024
.
Sample Input 2Copy
Copy
worldtourfinals2023
Sample Output 2Copy
Copy
worldtourfinals2024
Sample Input 3Copy
Copy
2023
Sample Output 3Copy
Copy
2024
�S is guaranteed to end with 2023
, possibly being 2023
itself.
Sample Input 4Copy
Copy
20232023
Sample Output 4Copy
Copy
20232024
#include<iostream>
using namespace std;
int main()
{ string s;
cin>>s;
int len = s.size();
s[len-1]='4';
cout<<s<<endl;
return 0;
}