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 |
ft...pascalIn Reply To:考虑了的,贴程序 Posted by:JiangLY at 2005-07-23 22:41:04 > var > c1,c2,c3:char; > k,n,a,b,c,la,lb,lc,sa,sb,sc,s:extended; > t:string; > begin > s:=0; > la:=0; > lb:=0; > lc:=0; > while not seekeof do > begin > read(c1,c2,c3); > t:=c1+c2+c3; > a:=(ord(c1)-48)*10+ord(c2)-48; > read(c1,c2,c3); > t:=t+c1+c2+c3; > b:=(ord(c1)-48)*10+ord(c2)-48; > read(c1,c2); > t:=t+c1+c2; > c:=(ord(c1)-48)*10+ord(c2)-48; > sa:=a; > sb:=b; > sc:=c; > if la+lb+lc<>0 then > begin > n:=0; > if c<lc then > begin > c:=c+60; > b:=b-1; > n:=n+c-lc; > end > else n:=n+c-lc; > if b<lb then > begin > b:=b+60; > c:=c-1; > n:=n+(b-lb)*60; > end > else n:=n+(b-lb)*60; > n:=n+(a-la)*3600; > s:=s+n/3600*k; > end; > la:=sa; > lb:=sb; > lc:=sc; > if not seekeoln then > begin > readln(k); > end > else > begin > readln; > writeln(t,' ',s:1:2,' km'); > end; > end; > end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator