Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. double coordinate[1005][1005];
  5. int main(int argc, char const *argv[])
  6. {
  7. char a;
  8. int counter=0;
  9. while(cin>>a)
  10. {
  11. if(a=='*')
  12. {
  13. break;
  14. }
  15. else
  16. {
  17. double a,b,c,d;
  18. cin>>a>>b>>c>>d;
  19. coordinate[counter][0]=a;
  20. coordinate[counter][1]=b;
  21. coordinate[counter][2]=c;
  22. coordinate[counter][3]=d;
  23. counter++;
  24. }
  25. }
  26. double test1,test2;
  27. int counter2=1;
  28. while(cin>>test1>>test2)
  29. {
  30. bool flag=0;
  31. if(test1==9999.9 and test2==9999.9){
  32. break;
  33. }
  34. else{
  35. for(int i=0;i<=counter;i++){
  36. if(test2<=coordinate[i][1] and test2>=coordinate[i][3]){
  37. if(test1>=coordinate[i][0] and test1<=coordinate[i][2]){
  38. cout<<"Point "<<counter2<<" is contained in figure "<<i+1<<endl;
  39. flag=1;
  40. }
  41. }
  42. }
  43. if(flag==0){
  44. cout<<"Point "<<counter2<<" is not contained in any figure"<<endl;
  45. }
  46. counter2++;
  47.  
  48. }
  49.  
  50. }
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement