Advertisement
Guest User

Untitled

a guest
Feb 14th, 2011
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.97 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int dentro_ret (int x0, int yo, int x1, int y1, int x, int y);
  5.  
  6. int main(void)
  7. {
  8.     int x0, y0, x1, y1, x, y;
  9.    
  10.    printf("Entre com a posicao do ponto x0: ");
  11.    scanf("%d", &x0);
  12.    printf("Entre com a posicao do ponto y0: ");
  13.    scanf("%d", &y0);
  14.    printf("Entre com a posicao do ponto x1: ");
  15.    scanf("%d",&x1);
  16.    printf("Entre com a posicao do ponto y1: ");
  17.    scanf("%d",&y1);
  18.    printf("Entre com a posicao do ponto x: ");
  19.    scanf("%d",&x);
  20.    printf("Entre com a posicao do ponto y: ");
  21.    scanf("%d",&y);
  22.    
  23.    dentro_ret(x0, y0, x1, y1, x, y); //chama a funcao
  24.    printf("A resposta eh: %d", dentro_ret);
  25.     getch();
  26.     return 0;
  27. }
  28.  
  29. int dentro_ret (int x0, int y0, int x1, int y1, int x, int y)
  30. {
  31.  
  32. //int x0, y0, x1, y1, x, y;
  33. int r;
  34.      if ((x0==x) < (x==x) && (x1==y) < (y==y)&& (y0==x) > (x==x) && (y1==y) > (y==y)){
  35.           r = 1;
  36.      }else{
  37.        r = 0;
  38.       }    
  39.      return r;
  40.  
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement