您当前的位置: 首页 > 

POJ 3981.字符串替换

发布时间:2022-01-09 11:14:11 ,浏览量:0

POJ 3981.字符串替换

Ideas

字符串替换的水题。

需要注意的就是题目测试用例是多行数据,一开始没有注意导致WA,又看了一遍题目才发现。

Code C++
#include  #include   using namespace std; int main() { string str; while (getline(cin, str)) { while (str.find("you") != string::npos) str.replace(str.find("you"), 3, "we"); cout << str << endl; } return 0; } 
在线评测:https://vjudge.net/problem/POJ-3981
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    108697博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0460s