Posted on 2009-06-03 16:31
Hero 阅读(82)
评论(0) 编辑 收藏 引用 所属分类:
代码如诗--ACM
1 //1221 Accepted 15 196 710 C++
2
3 #include <iostream>
4 #include <string>
5 #include <algorithm>
6 using namespace std ;
7
8 const int size = 2000 ;
9
10 int tnum ;
11 int inn ;
12
13 int main()
14 {
15 while( cin >> tnum )
16 {
17 while( tnum -- )
18 {
19 int x1, y1, x2, y2 ;
20 cin >> x1 >> y1 >> x2 >> y2 ;
21 int x, y, r ;
22 cin >> x >> y >> r ;
23
24 bool OK = true ;
25 if( !( x>x1&&x<x2&&y>y1&&y<y2 ) )
26 {
27 OK = false ;
28 }
29 int a = abs( x - x1 ) ;
30 int b = abs( x - x2 ) ;
31 int c = abs( y - y1 ) ;
32 int d = abs( y - y2 ) ;
33
34 if( a < r || b < r || c < r || d < r )
35 {
36 OK = false ;
37 }
38
39 if( OK )
40 printf( "Just do it\n" ) ;
41 else
42 printf( "Don't get close to it\n" ) ;
43 }
44 }
45
46 return 0 ;
47 }