fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string a, b;
  6.  
  7. int main(){
  8. cin >> a >> b;
  9. if (a.size() > b.size()){
  10. cout << a.size();
  11. return 0;
  12. }else{
  13. if (a.size() < b.size()){
  14. cout << b.size();
  15. return 0;
  16. }else{
  17. if (a == b) cout << -1;
  18. else{
  19. cout << a.size();
  20. }
  21. }
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 15240KB
stdin
abcd
defgh
stdout
5