Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
一直WA....高手们帮慢看哈!!.....谢谢哈#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { int n=1, i, j, k, b=0, arrayx[1000],arrayy[1000], t, p=0; while(scanf("%d",&n),n != 0){ for(i=0;i<n;i++){ scanf("%d %d",&arrayx[i],&arrayy[i]); } if(n<=2){ printf("%d\n",n); continue; } else{ for( i=1;i<=n-2;i++){ for( j=i+1;j<=n-1;j++){ int count = 2; for( k=j+1;k<=n;k++){ if( (arrayx[i]-arrayx[j])*(arrayy[j]-arrayy[k])==(arrayx[j]-arrayx[k])*(arrayy[i]-arrayy[j]) )count++; } if(count>p)p = count; } } printf("%d\n",p); p=0; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator