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

这段代码错在哪儿,为什么提示Runtime error

Posted by zys6411 at 2012-06-02 14:21:40 on Problem 3981
#include <string>
#include <iostream>
using namespace std;
int main()
{
	string str,dest;
	while(getline(cin,str))
{
	int m=0;
	for(int i=0; i<(int)str.length();i++)
	{
		if (str[i]=='y'&&str[i+1]=='o'&&str[i+2]=='u')
		{
			dest[m++]='w';
			dest[m++]='e';
			i=i+2;
		}
		else
		dest[m++]=str[i];
	}
	dest[m]='\0';
	cout<<dest<<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