Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- double coordinate[1005][1005];
- int main(int argc, char const *argv[])
- {
- char a;
- int counter=0;
- while(cin>>a)
- {
- if(a=='*')
- {
- break;
- }
- else
- {
- double a,b,c,d;
- cin>>a>>b>>c>>d;
- coordinate[counter][0]=a;
- coordinate[counter][1]=b;
- coordinate[counter][2]=c;
- coordinate[counter][3]=d;
- counter++;
- }
- }
- double test1,test2;
- int counter2=1;
- while(cin>>test1>>test2)
- {
- bool flag=0;
- if(test1==9999.9 and test2==9999.9){
- break;
- }
- else{
- for(int i=0;i<=counter;i++){
- if(test2<=coordinate[i][1] and test2>=coordinate[i][3]){
- if(test1>=coordinate[i][0] and test1<=coordinate[i][2]){
- cout<<"Point "<<counter2<<" is contained in figure "<<i+1<<endl;
- flag=1;
- }
- }
- }
- if(flag==0){
- cout<<"Point "<<counter2<<" is not contained in any figure"<<endl;
- }
- counter2++;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement