| ||||||||||
| 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 | |||||||||
用指针式可以的~~#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator