摘要: 求相交点 1 /* 2 线段相交模板:判相交、求交点 3 */ 4 #include 5 #include 6 #include 7 #include 8 9 const double eps = 1e-8;10 struct Point{11 double x,y;12 };13 Point P_ans;14 double cross( Point a,Point b,Point c ){15 return ( b.x-a.x )*( c.y-a.y )-( b.y-a.y )*( c.x-a.x );16 }17 int solve( Point a,Point b,Po... 阅读全文
posted @ 2013-07-18 23:06 xxx0624 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 题意看不懂的直接看百度百科对黑白棋的解释。。。做法:分情况讨论,一共8个方向。 1 /* 2 搜索 3 */ 4 #include 5 #include 6 const int maxn = 10; 7 char mat[ maxn ][ maxn ]; 8 const int dx[]={-1,1,-1,1}; 9 const int dy[]={1,-1,-1,1}; 10 11 int max( int a,int b ){ 12 return a>b?a:b; 13 } 14 15 bool in( int x,int y ){ 16 if( x>... 阅读全文
posted @ 2013-07-18 10:18 xxx0624 阅读(304) 评论(0) 推荐(0) 编辑