Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <vector>
- #include <map>
- #include <string>
- #include <cstring>
- #include <set>
- #include <queue>
- #include <stack>
- #include <bitset>
- #include <algorithm>
- #include <cstdio>
- #include <cstdlib>
- #include <cmath>
- using namespace std;
- int main()
- {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- string as, bs;
- cin >> as >> bs;
- if (as.length() > bs.length())
- {
- cout << "0\n";
- return 0;
- }
- if (as.length() < bs.length())
- {
- cout << "Bad luck";
- return 0;
- }
- cout << "1\n";
- for (int i = 0; i < as.length(); i++)
- if (as[i] < bs[i])
- {
- cout << i + 1 << endl;
- return 0;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment