Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct ponto {
- float x;
- float y;
- };
- struct triangulo {
- float x0;
- float y0;
- float x1;
- float y1;
- };
- int main () {
- struct ponto p;
- struct triangulo tri;
- printf("Digite as coordenadas do ponto (x,y): ");
- scanf("%f %f", &p.x, &p.y);
- printf("Digite as coordenadas do verticio inferior esquerdo (x0,y0) e superior direito (x1,y1)\n");
- scanf("%f %f %f %f", &tri.x0, &tri.x1, &tri.y0, &tri.y1);
- if( p.x > tri.x0 && p.x < tri.x1) {
- if ( p.y > tri.y0 && p.y < tri.y1) {
- printf("Tรก dentro do retaangulo\n");
- }
- }
- printf("O ponto fornecido foi: (%.2f, %.2f)\n", p.x, p.y);
- return 0;
- }
Add Comment
Please, Sign In to add comment