daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. struct ponto {
  4. float x;
  5. float y;
  6. };
  7.  
  8. struct triangulo {
  9. float x0;
  10. float y0;
  11. float x1;
  12. float y1;
  13. };
  14.  
  15. int main () {
  16. struct ponto p;
  17. struct triangulo tri;
  18. printf("Digite as coordenadas do ponto (x,y): ");
  19. scanf("%f %f", &p.x, &p.y);
  20. printf("Digite as coordenadas do verticio inferior esquerdo (x0,y0) e superior direito (x1,y1)\n");
  21. scanf("%f %f %f %f", &tri.x0, &tri.x1, &tri.y0, &tri.y1);
  22.     if( p.x > tri.x0 && p.x < tri.x1)  {
  23.         if ( p.y > tri.y0 && p.y < tri.y1) {
  24.         printf("Tá dentro do retaangulo\n");
  25.         }
  26.     }
  27. printf("O ponto fornecido foi: (%.2f, %.2f)\n", p.x, p.y);
  28. return 0;
  29. }
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