#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<string>
#include<math.h>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
string s;
int i;
double speed = 0.0;
double road;
double time;
double time1;
double past;
time = ;
past = ;
road = ;
getline(cin,s);
time = (double(s[]-'')*10.0+double(s[]-''))+(double(s[]-'')*10.0+double(s[]-''))/60.0+(double(s[]-'')*10.0+double(s[]-''))/3600.0;
if(s.length() > )
{
for(i = ; i < s.length(); ++ i)
{
speed = speed*10.0 + double(s[i]-'');
}
}
else
{
cout<<s<<" "<<"0.00 km"<<endl;
}
time *= ;
while(getline(cin,s))
{
if(s.length() > )
{
time1 = (double(s[]-'')*10.0+double(s[]-''))+(double(s[]-'')*10.0+double(s[]-''))/60.0+(double(s[]-'')*10.0+double(s[]-''))/3600.0;
time1 *= 60.0;
past += speed*(time1-time);
time = time1;
speed = ;
for(i = ; i < s.length(); ++ i)
{
speed = speed*10.0 + double(s[i]-'');
}
}
if(s.length() == )
{
time1 = (double(s[]-'')*10.0+double(s[]-''))+(double(s[]-'')*10.0+double(s[]-''))/60.0+(double(s[]-'')*10.0+double(s[]-''))/3600.0;
time1 *= 60.0;
cout<<s<<' ';
cout<<setiosflags(ios::fixed)<<setprecision()<<(speed*(time1-time)+past)/60.0<<' '<<"km"<<endl;
}
} }

POJ 2501的更多相关文章

  1. poj 2501 Average Speed

    Average Speed Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4842   Accepted: 2168 Des ...

  2. POJ 1039 Pipe【经典线段与直线相交】

    链接: http://poj.org/problem?id=1039 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#probl ...

  3. 【POJ 3026】Borg Maze

    id=3026">[POJ 3026]Borg Maze 一个考察队搜索alien 这个考察队能够无限切割 问搜索到全部alien所须要的总步数 即求一个无向图 包括全部的点而且总权值 ...

  4. poj和hdu部分基础算法分类及难度排序

    最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...

  5. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  6. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

  7. POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286 ...

  8. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  9. POJ 3254. Corn Fields 状态压缩DP (入门级)

    Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Descr ...

随机推荐

  1. 2018.10.25 bzo1227: [SDOI2009]虔诚的墓主人(组合数学+扫描线+bit)

    传送门 有点难调啊.其实是我自己sb了 不过交上去1A1A1A还是平衡了一下心态. 所以这道题怎么做呢? 我们考虑对于一个点(x,y)(x,y)(x,y)如果这个点成为中心,正左/右/上/下分别有l/ ...

  2. vue 开发系列(五) 调用原生API

    概要 我们在开发手机端程序的时候了,我们经常需要使用到拍照,二维码的功能.数字天堂公司提供了大量的原生API支持. http://www.html5plus.org/doc/ 实现 1.在hbuild ...

  3. Le Chapitre V

    Chaque jour j'apprennais quelque chose sur la planète, sur le départ, sur le voyage. Ca venait tout ...

  4. 移植UC15 3G模块

    https://blog.csdn.net/jack_a8/article/details/43114083 https://wenku.baidu.com/view/7ea5c9cd52d380eb ...

  5. php 安装扩展

    安装mysqli扩展 1.到php文件ext下的mysqli      cd /usr/local/php-7.1.5/ext/mysqli 2.在mysqli文件夹下执行 /usr/local/ph ...

  6. tokudb_tmp_dir导致的tokudb加载失败

    安装TOKUDB数据库,安装完成后为了使配置生效,重启完数据库后,发现: mysql> show engines; +--------------------+---------+ | Engi ...

  7. AngularJS监听数组变化

    我们在使用angualr的监听时候,业务的需要我们会去监听一个数组的某一个值得变化,再写逻辑代码.然而我们在使用$scope.$watch("",function(){ })时候会 ...

  8. Mysql之数据表操作

    数据表操作: 查看当前数据库中所有的表: show tables; 查看当前使用数据库: select database(); 使用数据表: use 表名; 创建数据表: create table 数 ...

  9. Lambda架构

    转载:https://blog.csdn.net/brucesea/article/details/45937875 1.Lambda架构背景介绍 Lambda架构是由Storm的作者Nathan M ...

  10. poj1321 DFS

    棋盘问题 Time Limit: 1000 MS Memory Limit: 10000 KB 64-bit integer IO format: %I64d , %I64u Java class n ...