fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int i=0, j=0;
  5. char type;
  6. double rec[10][4], x,y;
  7. while((type = getchar()) != '*' && type == 'r'){
  8. scanf("%lf %lf %lf %lf", &rec[i][j], &rec[i][j+1], &rec[i][j+2], &rec[i][j+3]);
  9. printf("%lf %lf %lf %lf\n", rec[i][j], rec[i][j+1], rec[i][j+2], rec[i][j+3]);
  10. i++;
  11. }
  12. int count = 1;
  13. while(scanf("%lf %lf", &x, &y) && (x != 9999.9 && y != 9999.9)){
  14. for(int k = 0; k < i; k++){
  15. if( (rec[i][1] > y && rec[i][3] < y) && (rec[i][0] < x && rec[i][2] > x) )
  16. printf("Point %d is contained in figure %d", count, k+1);
  17. }
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 9424KB
stdin
r 8.5 17.0 25.5 -8.5
r 0.0 10.3 5.5 0.0
r 2.5 12.5 12.5 2.5
*
2.0 2.0
4.7 5.3
6.9 11.2
20.0 20.0
17.6 3.2
-5.2 -7.8
9999.9 9999.9
stdout
8.500000 17.000000 25.500000 -8.500000
0.000000 10.300000 5.500000 0.000000
2.500000 12.500000 12.500000 2.500000