1050 String Subtraction 发表于 2020-05-30 给2个字符串,要求输出S1-S2,结果不能出现S2中出现的字符。 1234567891011121314151617181920212223242526272829#include <iostream>#include <string.h>using namespace std;char s1[10001], s2[10001];int main() { cin.getline(s1, 10001); cin.getline(s2, 10001); int len1 = strlen(s1); int len2 = strlen(s2); bool ASCII[300] = {false}; for (int i = 0; i< len2; i++) { ASCII[s2[i]] = true; } for (int i = 0; i < len1; i++) { if (ASCII[s1[i]] == false) { printf("%c", s1[i]); } } return 0;}// 因为输入会有空格,所以用cin.getline()来读取一行,用scanf遇到空格会停止They are students.aeiouThy r stdnts.