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

算法初步——哈希表A1050.String Subtraction_第1张图片

 

 

#include 
#include
#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;ii){
        char c = fir[i];
        for(j=0;jj){
            if(c == sec[j]){
                break;
            }
        }
        if(j == len2){
            cout<<c;
        }
    }
    system("pause");
    return 0;
} 

你可能感兴趣的:(算法初步——哈希表A1050.String Subtraction)