d141. Linearity
標籤 :
通過比率 : 296人/335人 ( 88% ) [非即時]
評分方式:
Tolerant

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

內容
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 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.
輸出說明
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.
範例輸入 #1
2
1,2 2,3 -30,-29
1,1 2,1 3,4
範例輸出 #1
collinear
not collinear
測資資訊:
記憶體限制: 512 MB
提示 :
標籤:
出處:
章魚教學網站-97學年度程設馬拉松賽 [管理者: taichunmin (和風信使) ]

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」