题解 | #删除公共字符#
删除公共字符
https://www.nowcoder.com/practice/f0db4c36573d459cae44ac90b90c6212?tpId=182&tqId=34789&ru=/exam/oj
#include <stdio.h> int Is_exist(char* arr, char ch) { while (*arr) { if (*arr == ch) { return 1; } arr++; } return 0; } int main() { char arr1[100] = { 0 }; char arr2[100] = { 0 }; gets(arr1); gets(arr2); int i = 0; while (arr1[i]) { if (Is_exist(arr2, arr1[i]) == 0) { printf("%c", arr1[i]); } i++; } return 0; }