Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

跪求高人指点.为啥没有输出结果了呢?小弟感激不尽。

Posted by 597503076 at 2008-12-03 08:46:33 on Problem 2606
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator