Guest User

Untitled

a guest
May 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <vector>
  4. #include <map>
  5. #include <string>
  6. #include <cstring>
  7. #include <set>
  8. #include <queue>
  9. #include <stack>
  10. #include <bitset>
  11. #include <algorithm>
  12. #include <cstdio>
  13. #include <cstdlib>
  14. #include <cmath>
  15.  
  16. using namespace std;
  17.  
  18. int main()
  19. {
  20.     freopen("input.txt", "r", stdin);
  21.     freopen("output.txt", "w", stdout);
  22.  
  23.     string as, bs;
  24.  
  25.     cin >> as >> bs;
  26.  
  27.     if (as.length() > bs.length())
  28.     {
  29.         cout << "0\n";
  30.         return 0;
  31.     }
  32.  
  33.     if (as.length() < bs.length())
  34.     {
  35.         cout << "Bad luck";
  36.         return 0;
  37.     }
  38.  
  39.     cout << "1\n";
  40.  
  41.     for (int i = 0; i < as.length(); i++)
  42.         if (as[i] < bs[i])
  43.         {
  44.             cout << i + 1 << endl;
  45.             return 0;
  46.         }
  47.  
  48.     return 0;
  49. }
Add Comment
Please, Sign In to add comment