Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int dentro_ret (int x0, int yo, int x1, int y1, int x, int y);
- int main(void)
- {
- int x0, y0, x1, y1, x, y;
- printf("Entre com a posicao do ponto x0: ");
- scanf("%d", &x0);
- printf("Entre com a posicao do ponto y0: ");
- scanf("%d", &y0);
- printf("Entre com a posicao do ponto x1: ");
- scanf("%d",&x1);
- printf("Entre com a posicao do ponto y1: ");
- scanf("%d",&y1);
- printf("Entre com a posicao do ponto x: ");
- scanf("%d",&x);
- printf("Entre com a posicao do ponto y: ");
- scanf("%d",&y);
- dentro_ret(x0, y0, x1, y1, x, y); //chama a funcao
- printf("A resposta eh: %d", dentro_ret);
- getch();
- return 0;
- }
- int dentro_ret (int x0, int y0, int x1, int y1, int x, int y)
- {
- //int x0, y0, x1, y1, x, y;
- int r;
- if ((x0==x) < (x==x) && (x1==y) < (y==y)&& (y0==x) > (x==x) && (y1==y) > (y==y)){
- r = 1;
- }else{
- r = 0;
- }
- return r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement