题解 | Letter Song ~ 致十年后的我们

Letter Song ~ 致十年后的我们

https://www.nowcoder.com/practice/34ad18b42bf640b8b93855936c24deae

#include <iostream>
using namespace std;
#include <string>
int main() {
    string s;
    cin>>s;
    int a=stoi(s.substr(0,4))+10;
     string s2=to_string(a);
     s.replace(0,4,s2);
    cout<<s<<endl;
    return 0; 
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务