Problem Description
2019年1月1日,在云栖出现了可能是全世界最长的以秒为单位的倒计时装置:九亿多秒倒计时,直到2050年。
给出一个时间S,我们想知道S距离2050年1月1日0点0时0分多少秒。
因为答案可能很大,请输出答案模100的值。
Input
第一行一个正整数 T (1≤T≤100000) 表示数据组数。
对于每组数据,一行一个字符串表示时间。
时间格式为:YYYY-MM-DD HH:MM:SS,分别表示年、月、日、时,分、秒。
输入的时间保证都在2019年1月1日以后(包含当天)。
Output
对于每组数据输出一行一个整数表示答案。
Sample Input
1 2019-01-01 00:00:00
Sample Output
0
Source
Test Contest
思路:请注意答案是%100的,一个小时有3600分钟,3600%100=0,因此年份、月份、日期、小时都是没有用的,读取分钟和秒钟即可。
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
string s;
int main()
{
int t;
scanf("%d",&t);
getchar();
int h,m,se;
while(t--)
{
getline(cin,s);
m=(s[14]-48)*10+s[15]-48;
se=(s[17]-48)*10+s[18]-48;
printf("%d\n",(3600-(m*60+se))%100);
}
return 0;
}