Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int Quarter(int x, int y)
- {
- int quat;
- if(x == 0 && y == 0)
- quat = 0;
- if(x > 0)
- {
- if(y > 0)
- quat = 1;
- else
- quat = 4;
- }
- else
- {
- if(y > 0)
- quat = 2;
- else
- quat = 3;
- }
- return quat;
- }
- int main()
- {
- int x, y;
- int i;
- for(i = 0; i < 3; i++)
- {
- printf("Vvedite koordinati %d tochki\n", i + 1);
- scanf("%d%d", &x, &y);
- printf("Eta tochka lezhit v %d chetverti\n", Quarter(x, y));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment