找到给定字符串的不同字符

 代码:

#include <iostream>
#include<map>
using namespace std;
int main()
{
  string s1,s2;
  cin>>s1>>s2;
  map<char,int>h;
  for(auto b:s1){
    h[b]++;
  }
  for(auto b:s2){
    h[b]--;
  }
  if(s1.length()>s2.length()) {
    for(auto b:s1){
      if(h[b]==1) cout<<b;
    }
  }
  else{
     for(auto b:s2){
      if(h[b]==1) cout<<b;
    }
  }
  // 请在此输入您的代码
  return 0;
}