Advertisement
Tec4Gen

Untitled

Nov 9th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int x, y;
  8. cin >> x >> y;
  9. if (x > y && x >=1 && x <=7 && y >= 1 && y <= 7) {
  10. x = abs((7 - x) - (7 - y));
  11. if (abs(x) > 7-x) {
  12. cout << 7 - x << " " << x;
  13. }
  14. else {
  15. cout << x << " " << 7 - x;
  16. }
  17. }
  18. else if (y > x) {
  19.  
  20. x = abs((7 - y) - (7 - x));
  21.  
  22. if ((abs(x) > 7 - y)) {
  23. cout << 7 - x<< " " << x;
  24. }
  25. else {
  26. cout << x << " " << 7 - x;
  27. }
  28. }
  29. return 0;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement