/C06007 - Loại bỏ từ trong xâu
<Problem>
https://code.ptit.edu.vn/student/question/C06007#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main() {
char s[201];
gets(s);
char sub[201];
gets(sub);
char arr[100][100];
int len = 0;
const char* delim = " ";
char* token = strtok(s, delim);
while (token != NULL) {
strcpy(arr[len++], token);
token = strtok(NULL, delim);
}
for (int i = 0; i < len; i++) {
if (strcmp(arr[i], sub) != 0) {
printf("%s ", arr[i]);
}
}
return 0;
}