//同题目1118的原理是一样的!只是改一改输入就可以了!
#include <iostream>
#include <climits>
using namespace std;
struct Info
{
int x;
int y;
}cor[205];
int main()
{
int n, i, j, k, ans, max;
cin >> n;
ans = 0;
max = 0;
for (i = 1; i <= n; i++)
cin >> cor[i].x >> cor[i].y;
for (i = 1; i <= n; i++)
{
for (j = i+1; j <= n; j++)
{
max = 0;
for (k = j+1; k <= n; k++)
{
if ((cor[j].x - cor[i].x)*(cor[k].y - cor[j].y) == (cor[j].y - cor[i].y)*(cor[k].x - cor[j].x))
max++;
}
if (max > ans)
ans = max;
}
}
cout << ans + 2<< endl;
system("pause");
}
poj 2606 Rabbit hunt
最新推荐文章于 2017-04-23 13:31:15 发布