当前位置:网站首页>ZZULIOJ:1015: 计算时间间隔
ZZULIOJ:1015: 计算时间间隔
2022-08-10 03:39:00 【追上】
1015: 计算时间间隔
时间限制: 1 Sec 内存限制: 30 MB
[状态] [讨论版] [提交] [命题人:admin]
题目描述
读入两个用“时:分:秒”表示的时间点,计算以秒为单位的时间间隔。
输入
输入有两行,每行是一个用“时:分:秒”表示的时间点。测试数据保证第二个时间点晚于第一个时间点。
输出
输出一个整数,表示时间间隔的秒数。
样例输入 Copy
08:00:00
09:00:00样例输出 Copy
3600提示
输入数据中带有普通字符,如冒号,scanf函数的格式字符串中对应位置上也要有对应字符。
参考代码
#include <stdio.h>
int main()
{
int a1,b1,c1,a2,b2,c2,x;
scanf("%d:%d:%d\n%d:%d:%d",&a1,&b1,&c1,&a2,&b2,&c2);
x=3600*a2+60*b2+c2-3600*a1-60*b1-c1;
printf("%d", x);
return 0;
}
边栏推荐
猜你喜欢

互联网家装驶入深水区:谁在求变,又有谁在裸泳?

The so-called software testing ability is actually these 5 points

数据切片问题

Small program subcontracting and subcontracting pre-download

Classes and interfaces

【Mindspore】【310推理】导入mindir文件出错

program internationalization

一篇文章教你Pytest快速入门和基础讲解,一定要看

goland console shows overlapping problem solution

Evaluation and Construction of Enterprise Network Security Capability from the Sliding Ruler Model
随机推荐
Dynamic Web Development Fundamentals
ZZULIOJ:1029: 三角形判定
leetcode 27:移除元素
UDP协议之《套接口阻塞选项UDP_CORK》
质量小议13 -- 侥幸
TCP协议之《数据与控制流程交叉时的延迟处理》
Evaluation and Construction of Enterprise Network Security Capability from the Sliding Ruler Model
RoyalScope分析仪:发现CAN总线波形台阶和信号幅值低的问题
【网络迁移】Pytorch中的torch.no_grad对应MindSpore哪个方法
No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.
goland json.Marshal导致&变成\u0026
学习总结week4_2正则
全面深入了解什么是反向代理和负载均衡
charles的功能操作
互联网公司高频面试题精讲:测试计划和测试方案有什么区别?
Flink CDC介绍和个人理解
Jackson的ObjectMapper在项目中的主要运用
sql注入之宽字节注入,limit,order by
数据切片问题
进入Mysql数据库操作