Advertisement
ismaeil

Marah

Jun 8th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. string diff(string a ,string b){
  5.     string Ans = "";
  6.  
  7.     for(int i=0 ; i<a.size() ; i++){
  8.         bool flag = true;
  9.         for(int j=0 ; j<b.size() ; j++){
  10.             if( a[i] == b[j] ){
  11.                 flag = false;
  12.                 break;
  13.             }
  14.         }
  15.  
  16.         if( flag == true ){
  17.             Ans += a[i];
  18.         } else {
  19.             // No Thing
  20.         }
  21.     }
  22.  
  23.     return Ans;
  24. }
  25.  
  26. int main()
  27. {
  28.     string a ,b;
  29.     cin >> a >> b;
  30.  
  31.     string c = diff(a ,b);
  32.     cout << c << endl;
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement