Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

太晚了,睡前a道水题

Posted by TSERROF at 2012-10-24 23:41:54 on Problem 1488
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
	string ans;
	int i=0;
	while(getline(cin,ans))
	{
		unsigned loc=0;
		do 
		{
			++i;
			loc=ans.find('\"',loc);
			if(loc==string::npos){--i;break;}
			if(i%2)ans.replace(loc,1,"``");
			else ans.replace(loc,1,"''");
		} while (loc!=string::npos);
		cout<<ans<<endl;
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator