1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 |
#include<iostream> #include<stdio.h> using
namespace std ; int main() { int
n , m ; while ( scanf ( "%d%d" ,&n,&m) == 2) { if (m == 0 && n == 0) return
0 ; int
x[1005][2] , y[1005][2] , RGB[1005][3] ; int
i = 0 ; for (i = 0 ; i < n ; i++) cin >> x[i][0] >> y[i][0] >> x[i][1] >> y[i][1] >> RGB[i][0] >> RGB[i][1] >> RGB[i][2] ; while (m--) { bool
flag = true
; int
x1 , y1 ; cin >> x1 >> y1 ; for (i = n - 1 ; i >= 0 ; i--) { if (x1 >= x[i][0] && y1 >= y[i][0] && x1 <= x[i][1] && y1 <= y[i][1] ) { cout << RGB[i][0] << " "
<< RGB[i][1] << " "
<< RGB[i][2] << endl ; flag = false
; break
; } } if (flag) cout << "255"
<< " "
<< "255"
<< " "
<< "255"
<< endl ; } } return
0 ; } |
原文:http://www.cnblogs.com/scottding/p/3663273.html