显示代码纯文本
#include <iostream>
#include <cstring>
#include <cstdio>
#define maxn 100+5
using namespace std;
int main()
{
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
int t,n;
cin>>n;
int count=0,maxc;
int x[maxn],y[maxn];
float b,k;
for(int i=1;i<=n;i++)
cin>>x[i]>>y[i];
for(t=1;t<=n;t++)
{
for(int k=t+1;k<=n;k++)
{ count = 0;
if(x[t]==x[k])
{k=0;}
else
k=( y[t]-y[k] )/( x[t]-x[k] );
b=y[t]-k*x[t];
for(int i=1;i<=n;i++)
{double s=x[i]*k+b;
if(s==y[i])
count++;
}}}
if(maxc<count)
maxc=count;
cout<<maxc;
return 0;
}