输入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. 【VS开发】动态添加的ActiveX控件如何响应事件

    http://blog.csdn.net/xiaoqiqixiao/article/details/574542 今天在csdn上看到一朋友问如何响应动态添加的控件的事件,搜索资料,发现对于一般的应用 ...

  2. for循环实现九九乘法表

    <!--for循环实现九九乘法表--> <table border="> <tbody> {% for x in range(1,10) %} <t ...

  3. python 并发编程 协程 协程介绍

    协程:是单线程下的并发,又称微线程,纤程.英文名Coroutine.一句话说明什么是线程:协程是一种用户态的轻量级线程,即协程是由用户程序自己控制调度的 需要强调的是: 1. python的线程属于内 ...

  4. Mysql数据库表结构设计准则

    一:动静分离 解释:最好做好静态表和动态表的分离.这里解释一下静态表和动态表的含义,静态表:存储着一些固定不变的资源,比如城市/地区名/国家(静态表一定要使用缓存).动态表:一些频繁修改的表 二:关于 ...

  5. [转帖]RSA算法与DSA算法的区别

    RSA算法与DSA算法的区别 https://cloud.tencent.com/developer/news/254061 文章来源:企鹅号 - SuperFullStack 本文译自:StackE ...

  6. 树型DP入门

    题意: 某公司要举办一次晚会,但是为了使得晚会的气氛更加活跃,每个参加晚会的人都不希望在晚会中见到他的直接上司,现在已知每个人的活跃指数和上司关系(当然不可能存在环),求邀请哪些人(多少人)来能使得晚 ...

  7. [BZOJ 4820] [SDOI2017] 硬币游戏(高斯消元+概率论+字符串hash)

    [BZOJ 4820] [SDOI2017] 硬币游戏(高斯消元+概率论+字符串hash) 题面 扔很多次硬币后,用H表示正面朝上,用T表示反面朝上,会得到一个硬币序列.比如HTT表示第一次正面朝上, ...

  8. ubuntu 安装 TensorFlow、opencv3 的 tips

    安装tensorflow: 创建tensorflow虚拟环境 conda create -n  tensorflow python=2.7 输入命令查看可用版本的tensorflow-gpu cond ...

  9. day 01 常量 注释 int(整型) 用户交互input 流程控制语句if

    python的编程语言分类(重点) if 3 > 2: 编译型: 将代码一次性全部编译成二进制,然后再执行. 优点:执行效率高. 缺点:开发效率低,不能跨平台. 代表语言:C 解释型: 逐行解释 ...

  10. <form:select>

    <form:select path="classification" class="input-medium"> <form:option v ...