问题是这个警告在 15 和 18 警告:array subscript has type 'char' [-Wchar-subscripts]
处理样本输入:他们是学生。aeiou 样本输出:Thy r stdnts。
#include <cstdio>
#include <cstring>
const int MAXN = 10005;
char str1[MAXN], str2[MAXN];
bool HashTable[128] = {false};
//use HashTable to record the item need to minus
int main()
{
fgets(str1, sizeof(str1), stdin);
fgets(str2, sizeof(str2), stdin);
int len1 = strlen(str1);
int len2 = strlen(str2);
for (int i = 0; i < len2; i++) {
HashTable[str2[i]] = true;
}
for (int i = 0; i < len1; i++) {
if (HashTable[str1[i]] == false) {
printf("%c", str1[i]);
}
}
return 0;
}
我可以运行它,但我不知道警告。
这里