1093|1093 字符串A+B

#define MAX 100 char S[MAX]; //32-126 //0-94 95空格 int yes(char c){ if(c - NULL >= 32 &&c - NULL <= 126) if(S[c - NULL] == 0){ S[c - NULL] = 1; return 1; //可以输出 } else return 0; else if(c == ' ' && S[95] == 0){ S[95] = 1; return 1; } else return 0; } int main() { //freopen("D:\\文件夹\\Desktop\\use.txt","r",stdin); //int N,M; scanf("%d %d",&N,&M); getchar(); string s1,s2; getline(cin,s1); getline(cin,s2); memset(S,0,MAX); for(int i = 0; i< s1.length(); ++i){ if(yes(s1[i])) printf("%c",s1[i]); } for(int i = 0; i< s2.length(); ++i){ if(yes(s2[i])) printf("%c",s2[i]); }return 0; }

    推荐阅读