今天來解YKL16(UVA272):TeX Quotes
基數為 " => ``
偶數為 " => ''
#include <iostream>
#include <string>
using namespace std;
int main(){
string str;
int tmp=1;
while(getline(cin,str)){
for(int i=0;i<str.size();i++){
if(str[i] == '"' && tmp%2 == 1){
cout << "``";
tmp+=1;
}else if(str[i] == '"' && tmp%2 == 0){
cout << "''";
tmp+=1;
}else{
cout << str[i];
}
}
cout << endl;
}
return 0;
}