#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define N 10001
using namespace std;
string s1,s2,x;
int main(){
s1="abcdedfg";
s2=s1.substr(2,3);
cout<<s2<<endl;
x="d";
int ind = s1.find(x);
s1.erase(ind,1);
cout<<s1<<endl;
return 0;
}
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define N 10001
using namespace std;
string s1,s2,x;
int main(){
s1="abcdedfg";
s2=s1.substr(2,3);
cout<<s2<<endl;
x="d";
int ind = s1.find(x);
s1.erase(ind,1);
cout<<s1<<endl;
return 0;
}
评论区