d141. Linearity
Tags :
Accepted rate: 310人/ 350人 ( 89%) [非即時]
評分方式:
Tolerant

最近更新 : 2009-02-18 18:55

Content
A set of points is said to be collinear if they all lie on a single straight line. Clearly any two points are collinear since two points determine a line, but what about three points? Given three two-dimensional points (x,y), your program should determine if they are collinear.
Input
Input will consist of multiple cases with the first line giving the number of cases. Each case will be on a separate line. Each case consists of three distinct ordered pairs of integers. The integers will be separated by a comma, and each ordered pair will be separated by a space.
Output
For each set of three points, display whether or not they are collinear using the format shown in the example. In this example, the first three points line along the same line, while the second three do not.
Sample Input #1
2
1,2 2,3 -30,-29
1,1 2,1 3,4
Sample Output #1
collinear
not collinear
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (100%): 1.0s , <1M
Hint :
Tags:
出處:
章魚教學網站-97學年度程設馬拉松賽 [管理者: taichunmin (和風信使) ]

Status Forum 排行

ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」