1006. Sign In and Sign Out
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std; struct stu
{
char ID[];
int GetTime[];
int LeaveTime[];
}; stu Student[]; int main()
{
int n,i,j;
int m;
while(scanf("%d",&m)!=EOF)
{ for(j=;j<m;j++)
{
scanf("%s %d:%d:%d %d:%d:%d",Student[j].ID,&Student[j].GetTime[],&Student[j].GetTime[],&Student[j].GetTime[],&Student[j].LeaveTime[],&Student[j].LeaveTime[],&Student[j].LeaveTime[]);
} int GetHour,GetMin,GetSec,LeaveHour,LeaveMin,LeaveSec; GetHour=GetMin=GetSec=;
LeaveHour=LeaveHour=LeaveSec=-; int OpenMan,CloseMan; for(j=;j<m;j++)
{
if(Student[j].GetTime[]<GetHour)
{
GetHour=Student[j].GetTime[];
OpenMan=j;
}
else if(Student[j].GetTime[]==GetHour)
{
if(Student[j].GetTime[]<GetMin)
{
GetMin=Student[j].GetTime[];
OpenMan=j;
}
else if(Student[j].GetTime[]==GetMin)
{
if(Student[j].GetTime[]<GetSec)
{
GetSec=Student[j].GetTime[];
OpenMan=j;
}
}
} if(Student[j].LeaveTime[]>LeaveHour)
{
LeaveHour=Student[j].LeaveTime[];
CloseMan=j;
}
else if(Student[j].LeaveTime[]==LeaveHour)
{
if(Student[j].LeaveTime[]>LeaveMin)
{
LeaveMin=Student[j].LeaveTime[];
CloseMan=j;
}
else if(Student[j].LeaveTime[]==LeaveMin)
{
if(Student[j].LeaveTime[]>LeaveSec)
{
LeaveSec=Student[j].LeaveTime[];
CloseMan=j;
}
}
}
} printf("%s %s\n",Student[OpenMan].ID,Student[CloseMan].ID); }
return ;
}
1006. Sign In and Sign Out的更多相关文章
- PAT 甲级 1006 Sign In and Sign Out (25)(25 分)
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- 1006 Sign In and Sign Out (25 分)
1006 Sign In and Sign Out (25 分) At the beginning of every day, the first person who signs in the co ...
- PAT甲 1006. Sign In and Sign Out (25) 2016-09-09 22:55 43人阅读 评论(0) 收藏
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
- 1006 Sign In and Sign Out (25)(25 分)思路:普通的时间比较题。。。
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- pat 1006 Sign In and Sign Out(25 分)
1006 Sign In and Sign Out(25 分) At the beginning of every day, the first person who signs in the com ...
- PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642
PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642 题目描述: At the beginning of ever ...
- PTA (Advanced Level) 1006 Sign In and Sign Out
Sign In and Sign Out At the beginning of every day, the first person who signs in the computer room ...
- PAT甲级——1006 Sign In and Sign Out
PATA1006 Sign In and Sign Out At the beginning of every day, the first person who signs in the compu ...
- PAT1006:Sign In and Sign Out
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
- PAT Sign In and Sign Out[非常简单]
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
随机推荐
- Myeclipse8.5注册码
今天安装了Myeclipse8.5,记录一下. 一般官网上下载的都只能使用30天,要想使用更长时间,需要注册. 有一个生成注册码的网站:http://www.lephones.info 使用这个网站, ...
- cocos2d-x3.x使用rapidjson
rapidjson效率高,所以之前cocostudio里面解析用的jsoncpp也换成了rapidjson. 引擎又带有rapidjson库,所以不用单独去下载,直接就可以用. 这里主要写一下关于解析 ...
- iPhone screen size
iPhone 4 iPhone 5 iPhone 6 iPhone 6 Plus Display Size 3.5 in 4 in 4.7 in 5.5 in Screen Size 320 x ...
- oracle 自增列设置
序列 create sequence sq_1 minvalue maxvalue start increment cache ; 触发器 create or replace trigger 触发器名 ...
- SQL in与exists相关性能问题总结
SQL in与exists相关性能问题总结 in 和 exists in 和 exists的是DBA或开发人员日常工作学习中常用的基本运算符,今天我就这两个所带来的性能问题进行分析总结,方便自己与他 ...
- JavaScript的正则表达式使用
一:遇到问题 今天做项目时,在前台js对身份证号进行验证时,一直达不到预期的效果,我是监控文本域变量, $scope.watch('form.idNo',function(v){ if(!v){ re ...
- django 学习-11 Django模型数据模板呈现
1.for author in Author.objects.all(): for book in author.book_set.all(): print book 2.vim blog/vie ...
- (转)Salesforce的440亿美金并购宣告企业软件市场进入3.0互联网化时代
导语:Salesforce代表着“移动+云”时代企业软件领域新的架构和商业模式的颠覆者.企业软件转向“移动+云”架构,将极大改变传统企业IT市场的格局…… 近期一则新闻极大的刺激了企业软件市场的神经, ...
- browserify.js 的模块加载
browserify的模块加载基本上和nodejs的类似: nodejs 的模块加载是依次去读取文件然后用一个类eval() 函数执行并返回module.exports的结果.为了避免循环加载,在加载 ...
- 使用AngularJS构建大型Web应用
AngularJS是由Google创建的一种JS框架,使用它可以扩展应用程序中的HTML词汇,从而在web应用程序中使用HTML声明动态内容.在该团队工作的软件工程师Brian Ford近日撰写了一篇 ...