文章

25

粉丝

137

获赞

7

访问

119.4k

头像
查找 - 北邮(简单模拟-easy)
P1387 北京邮电大学
发布于2022年3月17日 09:46
阅读数 4.6k

 

#include<iostream>
#include<algorithm> 
using namespace std;
int main()
{
    string str, opt, temp;
    int n, i, len;
    while (cin >> str) {
        cin >> n;
        while (n--) {
            cin >> opt;
            i = opt[1] - '0';
            len = opt[2] - '0';
            if (opt[0] - '0' == 0) {
                temp = str.substr(i,len);
                reverse(temp.begin(), temp.end());
                str = str.substr(0,i) + temp +...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发