acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 资讯
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 简单

    #include<bits/stdc++.h>//神秘万能小开头 using namespace std; int main() { int x, y, q, n, ans=0; string s, t, a, b; cin >> s >> q; for(int i=0;i<q;++i){ cin >> n; if(n1){ cin >> t; cout << (s+=t) << endl; }else if(n2){ cin >> x >> t; cout << s.insert(x,t) << endl; }else if(n3){ cin >> x >> y; cout << s.erase(x,y) << endl; }else if(n4){ cin >> a >> b; while(s.find(a,ans)!=-1){ ans=s.find(a,ans); s.replace(ans,a.size(),b); ans+=b.size(); } ans=0; cout << s << endl; } else{ cin >> t; if(s.find(t)==-1){ cout << -1 << endl; }else{ cout << s.find(t) << endl; } } } return 0;//神秘万能小结尾 }

    userId_undefined
    喜小七 |重度同男依赖症😜|
    数组·数组操作员循环·循环打卡人分支·分支解题者字符串·魔法使俄罗斯套娃大师维度操控者
    10阅读
    1回复
    1点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页