返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     cin.tie(0);
  6.     cin.sync_with_stdio(0);
  7.     string str1="honolulu";
  8.     str1[5]='a';
  9.     cout<<str1<<endl;
  10.     string str2="honolulu";
  11.     int index=str2.find('u');
  12.     str2[index]='a';
  13.     cout<<str2<<endl;
  14.     string str3="hahahaha";
  15.     replace(str3.begin(),str3.end(),'a','o');
  16.     cout<<str3;
  17.     return 0;
  18. }
複製代碼
hahahahahahahaha

TOP

返回列表