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

runtime error

Posted by cymxing at 2007-07-22 15:54:10 on Problem 1922
#include<stdio.h>
float a[10000][2];
float b[10000];
int shijian(int m)
{
 int result;
 int i;
 for(i=0;i<m;i++)
 {if(a[i][1]>=0)
	b[i]=4.5*3600/a[i][0]+a[i][1];
  if(a[i][1]<0) 
	  b[i]=0;}
	return b[m];
}
int min(int m)
{int i;
 float t;
 for(i=0;i<m;i++)
 {  if(b[i]!=0)
	 t=b[i];
        if(t>b[i+i]&&b[i+1]!=0)
			t=b[i+1];
 }
 if(t==(int)t)
 printf("%d\n",(int)t);
 else
 printf("%d\n",(int)t+1);
 return t;
	
}
   
int main()
{int m;
 int i,j;
 while(1)

 {   
	 scanf("%d\n",&m);
	 if(m==0)
        break;
	 for(i=0;i<m;i++)
     for(j=0;j<2;j++)
		   scanf("%f",&a[i][j]);
           shijian(m);
           min(m);
          
 }
 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