# TED Quotes 題目連結 [UVA 272](https://onlinejudge.org/external/2/272.pdf) ## 中文簡述 讀取一個字串,當遇到`"`的時候,第一個改成` `` ` 第二個改成`''` ## solution: ``` #include <bits/stdc++.h> using namespace std; int main() { string a; bool inside = 1; while (getline(cin, a)) { while (a.find("\"")!=string::npos) { if (outside) a = a.replace(a.find_first_of("\""), 1, "``"); else a = a.replace(a.find_first_of("\""), 1, "\''"); outside=!outside; } cout << a << endl; } return 0; } ``` ###### tags: `UVA` 回目錄 [學習筆記](/gIBZqAbWTCis7uOPp149gA)