Advertisement
myloyo

ешка контест нетематический

Jul 11th, 2023
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4. #include <string>
  5. #include <algorithm>
  6. #include <set>
  7. #include <list>
  8. #include <sstream>
  9. #include <vector>
  10. #include <map>
  11. #include <numeric>
  12.  
  13. using namespace std;
  14. ifstream in("input.txt");
  15. ofstream out("output.txt");
  16.  
  17. int main() {
  18.     int a, b;
  19.     cin >> a >> b;
  20.     int c = a;
  21.     int d = b;
  22.     bool f = false;
  23.     int r = b - a;
  24.     for (int a = 9; a <= 1000; a++) {
  25.         if (a + 1 == b * 10 && to_string(a)[0] == to_string(c)[0] && to_string(b)[0] == to_string(d)[0]) {
  26.             cout << a << " " << b*10;
  27.             break;
  28.         }
  29.         else if (a + 1 == b * 100 && to_string(a)[0] == to_string(c)[0] && to_string(b)[0] == to_string(d)[0]) {
  30.             cout << a << " " << b*100;
  31.             break;
  32.         }
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement