SHARE
TWEET

Untitled

a guest Oct 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top