Created
March 27, 2016 20:12
-
-
Save joaogui1/61fe421f5c508f5a652d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
struct ret { | |
double x1,y1,x2,y2; | |
}; | |
ret vet[20]; | |
char c; | |
int i,sz; | |
double x,y; | |
bool check; | |
int main(){ | |
while(scanf(" %c", &c) and c != '*'){ | |
scanf("%lf %lf %lf %lf", &vet[sz].x1, &vet[sz].y1, &vet[sz].x2, &vet[sz].y2); | |
sz++; | |
} | |
while(scanf("%lf %lf", &x, &y) and x != 9999.9 and y != 9999.9){ | |
check = false; | |
i++; | |
for(int j = 0; j <= sz; j++){ | |
if(x > vet[j].x1 and x < vet[j].x2 and y < vet[j].y1 and y > vet[j].y2){ | |
check = true; | |
if(check)printf("Point %d is contained in figure %d\n",i,j+1); | |
} | |
} | |
if(!check)printf("Point %d is not contained in any figure\n",i); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment