Here is a program that reads a file and builds a histogram of the words in the file: process_file loops through the lines of the file, passi...
分类:
其他好文 时间:
2014-08-17 15:30:32
阅读次数:
176
【GL_LINES】 独立的线段,下式中,p2与p3间没有连线。 【GL_LINE_STRIP】 连续的线段,下式中, p2与p3会连成线段。 【GL_LINE_LOOP】 参考:《计算机图形学》3.4 OpenGL画线函数。
分类:
其他好文 时间:
2014-08-17 13:01:12
阅读次数:
830
Are you still remembering the then hot debated news about Oracle suing Google allegedly copying a small portion of codes from Oracle's Java in 2010. A...
分类:
其他好文 时间:
2014-08-16 12:29:10
阅读次数:
309
Every culture has its own etiquette red lines that tourists frequently aren’t aware they’re crossing. It doesn’t matter where you travel—you should ne...
分类:
其他好文 时间:
2014-08-15 17:17:39
阅读次数:
227
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, suc...
分类:
其他好文 时间:
2014-08-15 10:47:38
阅读次数:
255
题目地址:POJ 1269
直接套模板就可以了。。。实在不想自己写模板了。。。写的又臭又长。。。。不过这题需要注意的是要先判断是否有直线垂直X轴的情况。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
usi...
分类:
其他好文 时间:
2014-08-14 20:32:59
阅读次数:
165
解题报告
题目传送门
题意:
判断直线的位置关系(平行,重合,相交)
思路:
两直线可以用叉积来判断位置关系。
AB直线和CD直线
平行的话端点C和端点D会在直线AB的同一侧。
重合的话在直线AB上。
剩下就是相交。
求两直线交点可以用面积比和边长比来求。
看下面的图就知道了,推导就比较容易了
#include
#include
#include
...
分类:
其他好文 时间:
2014-08-14 01:38:37
阅读次数:
312
Problem Description
JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.
Half of these cities are rich in resource (we call them ri...
分类:
其他好文 时间:
2014-08-14 01:37:07
阅读次数:
237
c++/*The following example shows how the OnCustomDrawItem eventhandler draws items and lines of the tree view after the OnCustomDraw event handler has...
分类:
其他好文 时间:
2014-08-13 18:00:26
阅读次数:
306
1614: [Usaco2007 Jan]Telephone Lines架设电话线Time Limit:5 SecMemory Limit:64 MBSubmit:892Solved:399[Submit][Status]DescriptionFarmer John打算将电话线引到自己的农场,但电信...
分类:
其他好文 时间:
2014-08-13 10:07:05
阅读次数:
278