#18305: sstream


Timmy_ (徐洛享)

學校 : 國立內壢高級中學
編號 : 79648
來源 : [223.139.90.197]
最後登入時間 :
2021-09-25 22:53:11
c007. 00272 - TeX Quotes -- UVa272 | From: [114.137.129.171] | 發表日期 : 2019-07-04 00:00

#include <iostream>
#include <sstream>

using namespace std ;
int main ()
{
string line ;
bool a = true;
while(getline(cin ,line)){
ostringstream ss ("");
for(unsigned int x=0;x<line.length();x++){
if(line[x]=='"'){
if(a) ss << "``";
else ss << "''";
a=!(a);
}
else ss << line[x] ;
}
cout << ss.str() << endl ;
}
return 0;
}

 
ZeroJudge Forum