Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- freopen("candies.in", "r", stdin);
- freopen("candies.out", "w", stdout);
- string s1, s2;
- cin >> s1 >> s2;
- int l1 = s1.size(), l2 = s2.size();
- if (l1 < l2 || s1 == s2) {
- cout << "Bad luck\n";
- return 0;
- }
- if (l1 > l2 || s1 > s2) {
- cout << 0 << endl;
- return 0;
- }
- for (int i = 0; i < l1; i++) {
- if (s1[i] < s2[i]) {
- cout << 1 << endl << i + 1 << endl;
- return 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement