-
-
#include<iostream>
-
usingnamespacestd;
-
intmain()
- {
-
freopen("in.txt","r",stdin);
-
inth,m,s,k(0);
-
intpres(0),nows,time;
-
doublesum=0.0;
-
charc;
-
while(scanf("%d%c%d%c%d",&h,&c,&m,&c,&s)!=EOF)
- {
- c=getchar();
-
if(h==24)
- h=0;
-
if(c!='\n')
- {
-
if(pres!=0)
- {
- nows=s+m*60+h*60*60;
- time=nows-pres;
- sum+=time*k/3600.0;
- }
- cin>>k;
- }
-
else
- {
- nows=s+m*60+h*60*60;
- time=nows-pres;
-
if(k!=0)
- sum+=time*k/3600.0;
-
if(h<10)
-
cout<<0<<h<<":";
-
else
-
cout<<h<<":";
-
if(m<10)
-
cout<<0<<m<<":";
-
else
-
cout<<m<<":";
-
if(s<10)
-
cout<<0<<s<<"";
-
else
-
cout<<s<<"";
-
printf("%0.2lfkm\n",sum);
- }
- pres=s+m*60+h*60*60;
- }
-
return0;
- }
关键是输出格式的处理,还又要注意 24小时变为0小时
分享到:
相关推荐
According to the measurement results of the proof-of-concept prototypes, the proposed techniques are able to improve the operating speed and achieve excellent energy efficiency. The proposed ...
安装docker-compose安装标准版本docker-compose输入输出% Total % Received % Xferd Average Speed
float average_speed=0; uint RM_cap_new=0; uint RM_cap_old=0; uint RM_cap_count=0; uint RM_mai_kuai=0; float real_RM_speed=0.0; float total_distance=0; //测量值转化为实际值相关变量 float dis1=0; ...
namely safety, average speed, traffic density, and costs. Public guided rail transportation must remain competitive in this 21 century to face increasing quality, safety and cost requirements. These ...
本文介绍了一种新颖的多分辨率相对速度检测模型(Multi-Resolution Relative Speed Detection,简称MRSD),旨在改进VANET中的聚类算法,而且无需依赖全球定位系统(GPS)。 MRSD模型利用移动平均收敛发散(Moving ...
speed = np.random.normal(average_speed, std_dev_speed) road_type = np.random.choice(['city', 'suburb', 'highway'], p=路况_probs) driving_mode = np.random.choice(driving_modes) energy_used = energy...
ARMA模型,全称为自回归移动平均模型(Autoregressive Moving Average Model),是时间序列分析中常用的一种统计模型,常用于预测和建模具有自相关性的数据,如天气预报、股票价格、电力消耗等。在本例中,ARMA模型...
"平均速度"脚本,即average_speed.mq5,是MT5平台上的一个实用工具,它用于计算价格的平均变化率,这对于理解市场的动态和趋势具有重要意义。 1. **平均速度概念**: 平均速度的概念源自物理学,但在金融交易中,...
Average Speed ...0 Distance... .....0 Heart Rate ......0 no strokes detected, not sending data 一旦开始划船,数据应开始更新: Stroke Count.....100 Total Speed .....35 Average Spee
Bike - distance, average speed Yoga - exercises Elliptical - distance, heart rate, speed, calories, intensity setting Cardio - exercise, sets, reps Swim - laps, strokes Tennis - sets Dance Soccer
要求apt-get install jq curl 用法: root@nas:~# ./update_plex.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 83.1M 100 83.1M 0 0 38.8M 0 0:00:...
print("当前速度:\(speed * 3.6) km/h, 平均速度:\(averageSpeed * 3.6) km/h") } func calculateAverageSpeed(_ locations: [CLLocation]) -> Double { guard locations.count > 1 else { return 0 } var ...
API-mot-后端övningsuppgift1,文档av API基本信息: | jq使用jQuery回答结构小路:方法:身体数据:什么方法可以:服务器: : 路径:/ users / 1方法:GET身体数据: % Total % Received % Xferd Average Speed ...
Dataverse网络项目( )正在计划 。... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 185 100 185 0 0 313 0 --:--:-- --:--:-- --:--:--
- seg0到seg5是数码管显示的每一位,将speed_Average转换为10进制并分配给这些信号,用于显示电机转速。 2. **数码管显示模块**: - DE1-SOC的数码管引脚独立,无需动态刷新,可直接控制每个数码管的状态。 - ...
环氧的环氧树脂使易于在R Markdown文档中使用。 环氧树脂目前处于概念验证阶段。... ```{glue}The average speed of the cars was **{mean(cars$speed)} mph.**But on average the distance travelle
speed += (average_speed - total / len(speeds)) * standard_deviation / 2 # 调整量是偏差的一半 if speed speed = 5 elif speed > 13: speed = 13 total -= speeds[-1] speeds[-1] = speed total += ...
Typical/average gains are lower but still significant, a 10-50 times speedup can be considered typical. It adds support for live views to LINQ Live view is a LINQ query result that is kept ...
real 0m8.832suser 0m0.203ssys 0m3.176s[root@centos-nyc-12 ~ ] # time curl http://www.ovh.net/files/1Gio.dat --output /tmp/test1 % Total % Received % Xferd Average Speed Time Time Time Current ...