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

玩个小技巧

Posted by 1200017623 at 2013-01-12 14:04:05 on Problem 3981
#include<iostream>
#include<cstring>
using namespace std;
char line[1005] = {0};
int main(){
	while(cin.getline(line,1005)){
		int len = strlen(line);
		for(int i = 0;i < len - 2;++i){
			//No smile face, I persume?
			if(line[i] == 'y' && line[i+1] == 'o' && line[i+2] == 'u'){	//就是不想调间距,咋的
				line[i] = 'w';line[i+1] = 'e';line[i+2] = '\0';
			}
		}
		for(int j = 0;j < len;++j)if(line[j])putchar(line[j]);
		printf("\n");
		memset(line,0,1005*sizeof(char));
	}
	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