Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这段代码错在哪儿,为什么提示Runtime error#include <string> #include <iostream> using namespace std; int main() { string str,dest; 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator