摘要: 题意:给你一个箱子,已知隔板的位置,在给你玩具的位置,要你算出每个被隔出来的区域里有几个玩具。。。想法:利用叉乘,某玩具在X区域里,那么,这个点就在第x-1条线的右手边,第x条线的左手边,左右手方向利用叉乘来判断。。另外,我把左右边界也加入进了所以的线里面。。这样就不需要特殊判断了。。。 1 #include<stdio.h> 2 #include<string.h> 3 typedef struct point 4 { 5 int x,y; 6 }point; 7 typedef struct line 8 { 9 point a,b;10 }line;11 line 阅读全文
posted @ 2013-05-31 16:41 Yuki_i 阅读(274) 评论(0) 推荐(0)