请问一下我的代码错在哪里,只有一个AC
查看原帖
请问一下我的代码错在哪里,只有一个AC
560460
艾拉_Isla_楼主2021/9/11 22:32
#include <stdio.h>
#include <string.h>

int main()
{
	char a[205];
	char c[105],d[105];
	char *e;
	int i = 0;
	
	gets(a);
	gets(c);
	gets(d);
	e = strtok(a," ");
	while(e != NULL){
		if(strcmp(e,c) == 0){
			printf("%s",d);
		}else{
			printf("%s",e);
		}
		e = strtok(NULL," ");
		if(e != NULL){
			printf(" ");
		}
	}
	
	return 0;
}
2021/9/11 22:32
加载中...