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 ---------- --- ...
随机推荐
- Vue-cli 鼠标监听事件之滚动条
<template> <div class="scroll"> <div class="scroll-div-outer&quo ...
- [Vuejs] 在vue各个组件中应用全局scss变量
需要安装一个插件:sass-resources-loader 1.执行安装命令: npm i sass-resources-loader --save-dev 2.修改vue-cli环境下build文 ...
- Linux内核基础优化
Linux内核基础优化 net.ipv4.ip_forward = 1 #开启网络转发 net.ipv4.conf.default.rp_filter = 0 #开启代理功能 net.ipv4.con ...
- C语言Ⅰ博客作业05
这个作业属于那个课程 C语言程序设计II 这个作业要求在哪里 https://edu.cnblogs.com/campus/zswxy/CST2019-3/homework/9827 我在这个课程的目 ...
- Vue.js官方文档学习笔记(一)起步篇
Vue.js起步 Vue.js介绍 Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心库 ...
- Linux端口是否占用的方法
1.netstat或ss命令 netstat -anlp | grep 80 2.lsof命令 这个命令是查看进程占用哪些文件的 lsof -i:80 3.fuser命令 fuser命令和lsof正好 ...
- sql server 角度与弧度相互转换的函数radians(x)和degrees(x)
--RANDIANS(x)将参数x由角度转换为弧度 --DEGREES(x)将参数x由弧度转换为角度. 示例:select RADIANS(90.0), RADIANS(180.0), DEGREES ...
- KL散度的理解(GAN网络的优化)
原文地址Count Bayesie 这篇文章是博客Count Bayesie上的文章Kullback-Leibler Divergence Explained 的学习笔记,原文对 KL散度 的概念诠释 ...
- YOLOv3训练过程笔记
本人使用的是linux平台,按照YOLO网页0https://pjreddie.com/darknet/yolo/的步骤操作进行下载darkenet程序包以及编译,之后可尝试用VOC2007的数据集测 ...
- 2019-11-29-Roslyn-使用-Directory.Build.props-文件定义编译
title author date CreateTime categories Roslyn 使用 Directory.Build.props 文件定义编译 lindexi 2019-11-29 08 ...