【2018多校第一场】hdu6308-Time Zone(日期)
Problem Description
Given a time in Beijing time (UTC +8), Chiaki would like to know the time in another time zone s.
Input
The first line contains two integers a, b (0≤a≤23,0≤b≤59) and a string s in the format of "UTC+X'', "UTC-X'', "UTC+X.Y'', or "UTC-X.Y'' (0≤X,X.Y≤14,0≤Y≤9).
Output
Sample Input
Sample Output
//转化成分钟计算
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
int t, h, m;
char s[];
cin>>t;
while(t--)
{
scanf("%d%d%s", &h, &m, s);
h = h*+m;
int op = s[]=='+'?:-;
double x;
sscanf(s+, "%lf", &x);
x = (int)(x*+0.005); //读浮点数会有误差
int cha = x**op-*;
h = (h+cha)%(*);
if(h < ) h += *;
printf("%02d:%02d\n", h/, h%);
}
return ;
}
【2018多校第一场】hdu6308-Time Zone(日期)的更多相关文章
- Time Zone 【模拟时区转换】(HDU暑假2018多校第一场)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6308 Time Zone Time Limit: 2000/1000 MS (Java/Others) ...
- HDU6308(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6308 将时间化简为分钟计算,同时不要用浮点数计算,精度会出现问题: 如果采用精度,最好加 ...
- HDU6300(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6300 排个序就好了 #include<iostream> #include& ...
- HDU6301(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6301 队友AC的,没怎么看 #include<iostream> #incl ...
- HDU6299(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6299 两个字符串的排序可以分成四种情况: (1)str1左少右多 vs str2 左多右 ...
- HDU6298(2018多校第一场)
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6298 打表找规律: #include<bits/stdc++.h> usin ...
- 2019牛客多校第一场 I Points Division(动态规划+线段树)
2019牛客多校第一场 I Points Division(动态规划+线段树) 传送门:https://ac.nowcoder.com/acm/contest/881/I 题意: 给你n个点,每个点有 ...
- 牛客多校第一场 B Inergratiion
牛客多校第一场 B Inergratiion 传送门:https://ac.nowcoder.com/acm/contest/881/B 题意: 给你一个 [求值为多少 题解: 根据线代的知识 我们可 ...
- HDU6581 Vacation (HDU2019多校第一场1004)
HDU6581 Vacation (HDU2019多校第一场1004) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6581 题意: 给你n+1辆汽车, ...
随机推荐
- Akka in action (第一章 介绍Akka)
在本章 概述Akka 了解Actors和Actor系统 Akka的适用范围 在第一章中,会介绍给你Akk的个方面,它能做什么,与现有的解决方案有那些不同.重点关注Akka有哪些功能和使用范围和强大的并 ...
- asp.net操作GridView添删改查的两种方法 及 光棒效果
这部份小内容很想写下来了,因为是基础中的基础,但是近来用的比较少,又温习了一篇,发现有点陌生了,所以,还是写一下吧. 方法一:使用Gridview本身自带的事件处理,代码如下(注意:每次操作完都得重新 ...
- jQuery :gt 选择器 jQuery :lt 选择器
选择前 3 个之后的所有 <tr> 元素: $("tr:gt(2)"); 选择前 2 个 <tr> 元素: $("tr:lt(2)");
- elasticsearch 5.5.1 head插件安装
5.5.1版本与之前版本有很大不同. 1. 下载插件 git clone git://github.com/mobz/elasticsearch-head.git 2. 编译 cd elasticse ...
- 20145322第一次JAVA实验报告
20145322第一周JAVA实验报告 课程:Java程序设计 班级:1453 指导教师:娄嘉鹏 实验名称:Java开发环境的熟悉(Linux + Eclipse) 实验日期:2016.04.08 实 ...
- 20145324 《Java程序设计》第3周学习总结
20145324 <Java程序设计>第3周学习总结 教材学习内容总结 第四章 1.要产生对象必须先定义类,类是对象的设计图,对象是类的实例,建立实例要用new 2.参数名称与对象数据成员 ...
- linux字典生成工具crunch
安装 tar zxvf crunch-3.6.tgz cd crunch-3.6 gcc -Wall -lm -pthread -std=c99 -m64 -D_LARGEFILE_SOURCE -D ...
- dp_train_f
Vasya And The Mushrooms 题目大意:有2n个格子,分成上下两行,每行n个,每个格子有蘑菇每秒的生长值(rate),小姑娘从左上角出发(time=0),每秒必须移动,而且只能移动到 ...
- 06_zookeeper_原生API使用2
1. 设置znode节点数据(同步) import org.apache.zookeeper.*; import org.apache.zookeeper.data.Stat; import java ...
- ABP 源码分析汇总之 IOC
IOC的优点: 1. 依赖接口,而非实现,如下代码, 这样的好处就是,客户端根本不知道PersonService的存在,如果我们换一下IPersonService的实现,客户端不用任何修改, 说的简单 ...