HDU-1234_开门人和关门人。
一边读入一边记录,题目比较简单,直接放代码:
#include#include #include using namespace std; int main() { string opener,downer;//用来记录当天关门人和开门人 int N; cin>>N; while(N-->0) { string now;//表示正在输入的人的证件号 int h,m,s;//分别表示开门和关门的时间 int time;//用整数表示时间 int minopen=24*60*60,maxdown=0;//分别表示最早开门时间和最晚关门时间 int n;//表示总人数 cin>>n; while(n-->0) { cin>>now; scanf("%d:%d:%d",&h,&m,&s); time=h*60*60+m*60+s; if(time maxdown) { maxdown=time; downer=now; } } cout<