我希望你是我独家记忆

一段永远封存的记忆,随风而去
posts - 263, comments - 31, trackbacks - 0, articles - 3
   :: 首页 :: 新随笔 ::  :: 聚合  :: 管理

HLOJ_1221 圆在矩形内

Posted on 2009-06-03 16:31 Hero 阅读(80) 评论(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 }

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理