算法初步——哈希表A1050.String Subtraction

#include <bits/stdc++.h>
#include<math.h>
#include <string>
using namespace std;
const int MAX_LEN = 10005;
int main(){
    char fir[MAX_LEN];
    char sec[MAX_LEN];
    fgets(fir,MAX_LEN,stdin);
    fgets(sec,MAX_LEN,stdin);
    int len1 = strlen(fir);
    int len2 = strlen(sec);
    int j;
    for(int i=0;i<len1;++i){
        char c = fir[i];
        for(j=0;j<len2;++j){
            if(c == sec[j]){
                break;
            }
        }
        if(j == len2){
            cout<<c;
        }
    }
    system("pause");
    return 0;
} 
原文地址:https://www.cnblogs.com/JasonPeng1/p/12162439.html