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 |
SOS,哪位高手给点指导?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator