| ||||||||||
| 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 | |||||||||
跪求高人指点.为啥没有输出结果了呢?小弟感激不尽。#include<stdio.h>
#include<stdlib.h>
int Max(int x,int y);
int main()
{
int n;
int s[200];
int t[200];
int r[200]={2};
int i;
int g=0;
int m;
int h;
int count=0;
int j,p,k;
int A,B;
scanf("%d",&n);
for(i=0;i<n;i++)
{
/*printf("请输入第一个数\n");
s[i]=getchar();
printf("请输入第二个数\n");
t[i]=getchar();*/
scanf("%d %d\n",&s[i],&t[i]);
}
for(j=0;j<n;j++)
{
for(k=j+1;j<n;j++)
{
A=(t[k]-t[j])/(s[k]-s[j]);
B=t[k]-s[k]*A;
for(p=0;p<n&&p!=j&&p!=k;p++)
{
if(t[p]==A*s[p]+B)
{
r[g]++;
}
}
g++;
}
}
h=g;
for(m=0;m<=h;m++)
{
if(r[m]>count)
{
count=r[m];
}
}
printf("%d",count);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator