| ||||||||||
| 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<math.h>
struct node{
int x;
int y;
}a[710];
int main()
{
int i,j,n,k;
int sum=2,max=0;
int aa,bb;
while(scanf("%d",&n)!=EOF&&n)
{
if(n==0) break;
for(i=1;i<=n;i++)
scanf("%d %d",&a[i].x,&a[i].y);
for(i=1;i<n-2;i++)
{
for(j=i+1;j<n-1;j++)
{
aa=(a[i].y-a[j+1].y)*(a[j].x-a[j+1].x);
bb=(a[i].x-a[j+1].x)*(a[j].y-a[j+1].y);
if(aa==bb) sum++;
if(max<sum) max=sum;
}
}
printf("%d\n",max);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator