A1006
输入n行员工id以及到达和离开的时间,输出最早到达的员工的id和最晚离开的员工的id
注:字符串赋值函数strcpy(目标字符串,原字符串)字符串之间的赋值使用该函数,需要#include<string.h>
#include<cstdio>
#include<string.h>
int main(){
char signinid[],signoutid[],temid[];
int h1,m1,s1,h2,m2,s2,n,temin,temout;
long long signin=,signout=;
scanf("%d",&n);
while(n--){
scanf("%s %d:%d:%d %d:%d:%d", &temid,&h1,&m1,&s1,&h2,&m2,&s2);
temin=h1*+m1*+s1;
temout=h2*+m2*+s2;
if(temin<signin){
signin=temin;
strcpy(signinid,temid);
}
if(temout>signout){
signout=temout;
strcpy(signoutid,temid);
}
}
printf("%s %s",signinid,signoutid);
return ;
}
A1006的更多相关文章
- PTA A1005&A1006
第三天 A1005 Spell It Right (20 分) 题目内容 Given a non-negative integer N, your task is to compute the sum ...
- A1006. Sign In and Sign Out
At the beginning of every day, the first person who signs in the computer room will unlock the door, ...
- A1006. Sign In and Sign Out(25)
25/25,一遍过了,很开心. #include<bits/stdc++.h> using namespace std; struct record{ string id; string ...
- 2017百度之星初赛A-1006(HDU-6113)
思路:在图的外面包一圈'0'字符,然后dfs统计'0'字符的个数和'1'字符的个数.结果如下(num0表示0字符的个数,num1表示1字符的个数): num0 == 1 && num1 ...
- PAT A1006 Sign In and Sign Out (25)
AC代码 #include <cstdio> #include <algorithm> #include <iostream> using namespace st ...
- PAT甲级——A1006 Sign In and Sign Out
At the beginning of every day, the first person who signs in the computer room will unlock the door, ...
- PAT/查找元素习题集
B1004. 成绩排名 (20) Description: 读入n名学生的姓名.学号.成绩,分别输出成绩最高和成绩最低学生的姓名和学号. Input: 每个测试输入包含1个测试用例,格式为: 第1行: ...
- 部分常见ORACLE面试题以及SQL注意事项
部分常见ORACLE面试题以及SQL注意事项 一.表的创建: 一个通过单列外键联系起父表和子表的简单例子如下: CREATE TABLE parent(id INT NOT NULL, PRIMARY ...
- iot表和heap表排序规则不同
SQL> select * from (select * from t1 order by id ) where rownum<20; ID A1 A2 A3 ---------- --- ...
随机推荐
- Day05:循环问题 / 数组
循环嵌套 循环结构中包含完整的循环结构. 注意: 循环嵌套不限层次 各种循环语句都可以互相嵌套 内层循环中出现的break和continue只作用在内层循环中 外层循环循环一次 内层循环循环一遍 Ja ...
- 【HANA系列】SAP HANA跟我学HANA系列之创建计算视图一
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA跟我学HANA系 ...
- cocos2dx[3.2](1) 浅析cocos2dx3.2引擎目录
3.x的引擎目录与2.x的引擎目录的差别是非常大的.3.x主要是将引擎的各个文件按照用途进行了分类,使得引擎目录结构更加清晰了. 从目录中我们主要了解一下以下几个文件: 文件名 说明 build 官方 ...
- 逻辑回归2-scikit-learn参数介绍
1.1 scikit-learn参数介绍 1.1.1 导入 from sklearn.linear_model import LogisticRegression 1.1.2 版本 sci ...
- Vue-cli 鼠标监听事件之滚动条
<template> <div class="scroll"> <div class="scroll-div-outer&quo ...
- 【OpenCV开发】OpenCV:使用VideoCapture类进行视频读取和显示
原文来自:http://blog.csdn.net/thefutureisour/article/details/7530344 -------------以下为原文---------------这次 ...
- 【VS开发】模态对话框和非模态对话框
MFC中对话框有两种形式,一个是模态对话框(model dialog box),一个是非模态对话框(modeless dialog box). 一.模态对话框(model dialog box) 在程 ...
- (转)在Kubernetes集群中使用JMeter对Company示例进行压力测试
背景 压力测试是评估应用性能的一种有效手段.此外,越来越多的应用被拆分为多个微服务而每个微服务的性能不一,有的微服务是计算密集型,有的是IO密集型. 因此,压力测试在基于微服务架构的网络应用中扮演着越 ...
- Win10成功安装IIS后浏览器打开localhost正确显示的页面
- Java 架构师面试题
基础题目 Java线程的状态 进程和线程的区别,进程间如何通讯,线程间如何通讯 HashMap的数据结构是什么?如何实现的.和HashTable,ConcurrentHashMap的区别 Cookie ...