#11259: 歡迎參考 用 bool 判別 左引號 或 右引號


who_am_I (kruztw)

學校 : 國立臺灣師範大學
編號 : 54056
來源 : [36.224.144.147]
最後登入時間 :
2023-04-22 22:46:31

#include<iostream>
#include<string.h>
using namespace std;

int main(){

char x[100];
bool rec = true;

while(cin.getline(x, 100)){

for(int i = 0; i<strlen(x); i++)
if(x[i] == '"'){
if(rec)
cout << "``";
else
cout << "''";

rec = !rec;
}
else
cout << x[i];

cout << endl;
}
}