Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, l, pos = 0;
- cin>>a>>b>>l;
- pos = l%(2*(a+b));
- if(pos < a)
- cout<<"BOTTOM";
- else if(pos > a && pos < (a+b))
- cout<<"RIGHT";
- else if(pos > (a+b) && pos < (2*a+b))
- cout<<"TOP";
- else if(pos > (2*a+b) && pos < (2*(a+b)))
- cout<<"LEFT";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement