Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, b, l, pos = 0;
  8. cin>>a>>b>>l;
  9. pos = l%(2*(a+b));
  10. if(pos < a)
  11. cout<<"BOTTOM";
  12. else if(pos > a && pos < (a+b))
  13. cout<<"RIGHT";
  14. else if(pos > (a+b) && pos < (2*a+b))
  15. cout<<"TOP";
  16. else if(pos > (2*a+b) && pos < (2*(a+b)))
  17. cout<<"LEFT";
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement