Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <string>
- #include <algorithm>
- #include <set>
- #include <list>
- #include <sstream>
- #include <vector>
- #include <map>
- #include <numeric>
- using namespace std;
- ifstream in("input.txt");
- ofstream out("output.txt");
- int main() {
- int a, b;
- cin >> a >> b;
- int c = a;
- int d = b;
- bool f = false;
- int r = b - a;
- for (int a = 9; a <= 1000; a++) {
- if (a + 1 == b * 10 && to_string(a)[0] == to_string(c)[0] && to_string(b)[0] == to_string(d)[0]) {
- cout << a << " " << b*10;
- break;
- }
- else if (a + 1 == b * 100 && to_string(a)[0] == to_string(c)[0] && to_string(b)[0] == to_string(d)[0]) {
- cout << a << " " << b*100;
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement