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

又是stl

Posted by TangMing at 2009-04-23 23:11:38 on Problem 1488
// 22.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include<fstream>
#include<string>
#include<iostream>
using namespace std;
int main(int argc, char* argv[])
{   
	//ifstream cin("aaa.txt");
    char ss[200];
	string s;
	int p=1;
	while(cin.getline(ss,200))
	{
	 s=ss;
	  while(1)
	  {	  
	    if(s.find('"')!=4294967295&&p==1)
		{
	    s.replace(s.find('"'),1,"``");
		p=2;
		}
	    if(s.find('"')!=4294967295&&p==2)
		{
	    s.replace(s.find('"'),1,"''");
		p=1;
		}
	    else
			break;
	  } 
	
	  cout<<s<<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