# 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)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up