返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. #include<cmath>
  5. #include<string>
  6. using namespace std;
  7. int main()
  8. {
  9.         string str="apple0123456789";
  10.         cout<<"原字串:"<<str<<endl;
  11.     cout<<str.substr(1,11)<<endl;
  12.     cout<<str.substr(3,6)<<endl;
  13.     cout<<str.substr(5,7)<<endl;
  14.         system("pause");
  15.     return 0;
  16. }
複製代碼

TOP

返回列表