fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int c=0;
  6. string s,a;
  7. cin >> s >> a;
  8. int n = s.size();
  9. int t = a.size();
  10.  
  11. for(int i=n-1;i>=0;i--)
  12. {
  13. if(s[i]==a[i])
  14. {
  15. c++;
  16. }
  17. }
  18. cout << (n+t-2*c) << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5284KB
stdin
test
west
stdout
2