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 |
为什么我在机上运行没错,但提交就显示WRONG ANSWER呢,帮我看看好吗,谢谢!#include <stdio.h> #include <math.h> #include <stdlib.h> void main() { int i,n,v,t,time; float *p; scanf ("%d",&n); while (n!=0) { p=(float*)malloc(n*sizeof(float)); for (i=0;i<n;i=i+1) { scanf ("%d%d",&v,&t); p[i]=(float)(4.5*3600/v+t); if ((int)(p[i]*10)%10>0) p[i]=p[i]+1; } time=(int)p[0]; for (i=1;i<n;i=i+1) { if (p[i]<p[i-1]) time=(int)p[i]; } printf("%d\n",time); scanf ("%d",&n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator