输入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. SpringBoot 和 SpringCloud 之间关系?

    SpringBoot:专注于快速方便的开发单个个体微服务(关注微观):SpringCloud:关注全局的微服务协调治理框架,将SpringBoot开发的一个个单体微服务组合并管理起来(关注宏观):Sp ...

  2. token防爆破?

    先尝试例如删除token  猜token的值等操作 不行就burp抓包 选择Pitchfork模式.选择要爆破的参数 线程设置为1显然只有获取上一个请求返回的taken值才能,做下一次请求 点击Ref ...

  3. 【计算机视觉】阶编码本模型(Multi phase codebook model)

    转自:http://www.cnblogs.com/xrwang/archive/2012/04/24/MPCBBGM.html 多阶编码本模型(Multi phase codebook model) ...

  4. python 并发编程 多线程 GIL与多线程

    GIL与多线程 有了GIL的存在,同一时刻同一进程中只有一个线程被执行 多进程可以利用多核,但是开销大,而python的多线程开销小,但却无法利用多核优势 1.cpu到底是用来做计算的,还是用来做I/ ...

  5. hive_server2的权限控制

    CDH的core-sit开启: 第一个false表示用系统用户来和hive用户的权限绑定,但经测试并没有生效,所以可以改为true 第二项设置成ALL,表示创建者对其创建的表拥有所有的权限,这样也是比 ...

  6. 在Bean中获取spring 容器 并通过容器获取容器中其他bean

    spring 提供了Awear 接口去 让bean 能感受到外界的环境.Awear 接口有很多实现,常用的有 ApplicationContextAware (可以通过实现这个接口去获取Applica ...

  7. springboot - 应用实践(N)使用springboot内置的@Scheduled

    1.springboot开箱即用,内置调度任务的使用. 建一个简单的springboot工程,pom.xml: <?xml version="1.0" encoding=&q ...

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

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

  9. Android 之 悬浮窗口

    1. 创建并设置  WindowManager  类 WindowManager mWindowManager; // 取得系统窗体 mWindowManager = (WindowManager) ...

  10. Python基础——函数入门

    等待更新…………………… 后面再写