相关代码 |
|
# include int main() { int n, i, j, NO, x[201], y[201], k, t, m, max; scanf("%d",&n); for(i = 0; i < n; i++) scanf("%d%d",&x[i],&y[i]); if(n==2) {printf("2\n");return 0;} max = 0; for(i = 0; i < n - 1; i++) for(j = i + 1; j < n; j++) { NO = 2; k = x[j] - x[i]; t = y[j] - y[i]; for(m = 0; m < n; m++) { if(m==i||m==j) continue; if(t*(x[i]-x[m])==k*(y[i]-y[m])) NO++; } if(max } printf("%d\n",max); return 0; }
相关资源 |
|