[Offer收割]编程练习赛42 register

Ended

Participants:125

Verdict:Wrong Answer
Score:0 / 100
Submitted:2017-12-31 12:33:30

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
    string str = "abcd";
    int m = 0, n = 2;
    int k = 1;
    //freopen("42_4.in", "r", stdin);
    cin>>str;
    cin>>k;
    for(int i = 0;i < k;i++){
        cin>>m>>n;
        reverse(str.begin()+m, str.begin()+n+1);
        cout<<str<<endl;
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX