题目链接:POJ 1410 Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) end point: (11,2) rectangle: left-top: (1,5) right-bottom: (7,1) Figure 1: Line se…
http://poj.org/problem?id=1410 Intersection Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11329 Accepted: 2978 Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An ex…
题目链接:http://poj.org/problem?id=1410 Intersection Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 12822 Accepted: 3347 Description You are to write a program that has to decide whether a given line segment intersects a given rectangle.…
Intersection Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9996 Accepted: 2632 Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) …
/** 注意: 千万得小心..就因为一个分号,调了一个晚上... **/ #include <iostream> #include <algorithm> using namespace std; struct point { int x,y; }; struct line{ point a; point b; }; line l,lt;//l 直线 lt 矩形的边 int x1,x2,y1,y2; int mmax(double a,double b){ return a>…