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

麻烦帮忙解决一下compile error好吗

Posted by 90401599 at 2005-01-10 15:09:48 on Problem 1922
#include<stdio.h>
#include<math.h>
#define dis 4.5;
void main(){
    int n;
    scanf("%d\n",&n);
    while(n!=0){
	    int v[10000],t[10000];
	    int i,vv,tt,k;   
	    double time,s=0;
	    for(i=0;i<n;i++)
		    scanf("%d %d",v[i],t[i]);
	    int T=t[0];
	    for(;;)
		    if(t[i]<T){
			    k=i;
			    T=t[k];
			    vv=v[k];		    
		    }
	    for(tt=T;;tt++){
			while(s<dis){
	    	
			    double a=ceil((dis-s)/vv/3600);
			    for(i=0;i<n;i++){
				    if(vv*(tt-T)==v[i]*(tt-t[i])){
					    k=i;
					    s=s+vv*tt/3600;
					    vv=v[k];
					    T=tt;
				    }
				    else time=a+T;
			    }
			}
			
	    }
    	printf("%d\n",time);
	scanf("%d\n",&n);
    }
}

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