Advertisement
STANAANDREY

encr_test

Mar 9th, 2020
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int encriptvars(int x, int y)
  5. {
  6.     assert(x < 10 && y < 10);
  7.     int e = x * 100 + y;
  8.     return e;
  9. }
  10.  
  11. pair<int, int> extract(int e)
  12. {
  13.     int x = e / 100;
  14.     int y = e % 100;
  15.     return make_pair(x, y);
  16. }
  17.  
  18. int main()
  19. {
  20.     int e = encriptvars(2, 9);
  21.     cerr << e << endl;
  22.     pair<int, int> p = extract(e);
  23.     cerr << p.first << ' ' << p.second;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement