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 a2659633 at 2011-11-19 10:12:26 on Problem 3981
#include<stdio.h>
#include<string.h>
char ch[1003];
int main()
{
	char aim[]="you",tmp[]="we";
	char *p,*q=ch;
	while(gets(ch))
	{
		p=strstr(q,aim);
		while(p)
		{
			*p='\0';
			printf("%s",q);;printf("%s",tmp);q=p+3;
			p=strstr(q,aim);
		}
		printf("%s\n",q);
		q=ch;
	}
	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