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

SOS,哪位高手给点指导?

Posted by 555555 at 2004-12-05 11:52:44 on Problem 2008
#include<stdio.h>
#include<math.h>
void main()
{int num,a,b,c,p[1001],q[1001],i,h,w,output;
  scanf("%d",&num);
  scanf("%d %d %d",&a,&b,&c);
  for(i=1;i<=num;i++)
	  scanf("%d %d",p[i],q[i]);
  h=p[1];w=q[1];
  if(p[i]<=p[1])h=p[i];
  if(q[i]<=q[1])w=q[i];

  for(i=1;i<=num;i++)
  {output=0;
	  if(a*(p[i]-h)+b*(q[i]-w)<=c)
		  output=output+1;
  }printf("%d",output);
}


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