- 建议
12345678
- @ 2025-12-22 17:29:47
#include<bits/stdc++.h> using namespace std; int main(){ string str="abcdefg"; cout<<str<<endl; cout<<str[0]<<endl; cout<<str.size()<<endl; string str2="1234567"; cout<<str+str2<<endl; str.append ("AAA"); cout<<str<<endl; str.insert(5,"HHH"); cout<<str<<endl; str.erase(1,1); cout<<str<<endl; str.replace(1,2,"BBB"); cout<<str<<endl; return 0; }
2 条评论
-
-
@孙鸣远请文明用语!
- 1