输入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的更多相关文章

  1. PTA A1005&A1006

    第三天 A1005 Spell It Right (20 分) 题目内容 Given a non-negative integer N, your task is to compute the sum ...

  2. 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, ...

  3. A1006. Sign In and Sign Out(25)

    25/25,一遍过了,很开心. #include<bits/stdc++.h> using namespace std; struct record{ string id; string ...

  4. 2017百度之星初赛A-1006(HDU-6113)

    思路:在图的外面包一圈'0'字符,然后dfs统计'0'字符的个数和'1'字符的个数.结果如下(num0表示0字符的个数,num1表示1字符的个数): num0 == 1 && num1 ...

  5. PAT A1006 Sign In and Sign Out (25)

    AC代码 #include <cstdio> #include <algorithm> #include <iostream> using namespace st ...

  6. 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, ...

  7. PAT/查找元素习题集

    B1004. 成绩排名 (20) Description: 读入n名学生的姓名.学号.成绩,分别输出成绩最高和成绩最低学生的姓名和学号. Input: 每个测试输入包含1个测试用例,格式为: 第1行: ...

  8. 部分常见ORACLE面试题以及SQL注意事项

    部分常见ORACLE面试题以及SQL注意事项 一.表的创建: 一个通过单列外键联系起父表和子表的简单例子如下: CREATE TABLE parent(id INT NOT NULL, PRIMARY ...

  9. iot表和heap表排序规则不同

    SQL> select * from (select * from t1 order by id ) where rownum<20; ID A1 A2 A3 ---------- --- ...

随机推荐

  1. JS中document对象 && window对象

    所有的全局函数和对象都属于Window对象的属性和方法. 区别: 1.window 指窗体.Window 对象表示浏览器中打开的窗口. document指页面.document是window的一个子对 ...

  2. kali安装redis

    下载 wget http://download.redis.io/releases/redis-4.0.11.tar.gz 解压 tar -zxvf redis-4.0.11.tar.gz 切换目录 ...

  3. sql server CDC报错:超出存储过程、函数、触发器的最大嵌套层数(最大层为32)

     sys.sp_MScdc_capture_job   RAISERROR(22801, 10, -1)      --原本 go sys.sp_MScdc_capture_job; go --修改后 ...

  4. [gym101981M][2018ICPC南京M题]Mediocre String Problem

    题目链接 题目大意是问在$S$串中找区间$[i,j]$,在$T$串中找位置$k$,使得$S[i,j]$和$T[1,k]$可以组成回文串,并且$j-i+1>k$,求这样的三元组$(i,j,k)$的 ...

  5. LOJ 10214 计算器 题解

    题面 k==1时,快速幂就好了: k==2时,exgcd就好了,但要注意取模范围的控制: k==3时,BSGS可以解决高次同余方程: 然后就可以开心的A掉了,但要注意特殊情况的特判 #include ...

  6. C++线性表通过结构体实现操作和结构体字符串快速排序和shell排序结合

    #include<iostream> #include<string> #define ml 10 using namespace std; typedef struct{// ...

  7. 虚拟机Vmware-网络配置

    非主业,只做简单介绍 虚拟机安装完毕后,需要进行网络配置. 虚拟机有 3 种网络连接方式: 仅主机模式 Host-only:仅支持 虚拟机与宿主机之间进行通信,无法连接外网 桥接模式 bridge:可 ...

  8. Linux的环境变量.bash_profile .bashrc profile文件

    Shell变量有局部变量.环境变量之分.局部变量就是指在某个Shell中生效的变量,只在此次登录中有效.环境变量通常又称“全局变量”,虽然在Shell中变量默认就是全局的,但是为了让子Shall继承当 ...

  9. 使用Jenkins结合Gogs和SonarQube对项目代码进行测试、部署、回滚,以及使用keepalived+haproxy调度至后端tomcat

    0 环境说明 主tomcat:192.168.0.112 备tomcat:192.168.0.183 haproxy+keepalived-1:192.168.0.156 haproxy+keepal ...

  10. Winform CheckBox组,先横向排列,后纵向排列,点击文字,改变Checkbox的状态的方法

      开始选用的CheckedListBox控件,不能实现,改为使用ListView控件,可以满足需求.操作步骤如下: 1.将ListView的属性View改为SmallIcon. 2.CheckBox ...