AtCoder Beginner Contest 335(1)

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;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值