题目1022:游船出租
来源:互联网 发布:python class 理解 编辑:程序博客网 时间:2024/04/28 17:30
#include <stdio.h> int s_time[100]; int main() { char time[6]; char style; int i,t,order,sum=0,count=0; for(i=0;i<100;i++) s_time[i]=-1; while(1) { scanf("%d",&order); if(order==-1) break; if(order==0) { getchar(); style=getchar(); getchar(); scanf("%s",time); if(count==0) printf("0 0\n"); else printf("%d %d\n",count,int(sum*1.0/count+0.5)); sum=0; count=0; for(i=0;i<100;i++) s_time[i]=-1; } else { getchar(); style=getchar(); getchar(); scanf("%s",time); t=((time[0]-'0')*10+time[1]-'0')*60+(time[3]-'0')*10+time[4]-'0'; if(style=='S') s_time[order-1]=t; else if(style=='E'&&s_time[order-1]!=-1) { sum+=t-s_time[order-1]; count++; s_time[order-1]=-1; } } } return 0; } /************************************************************** Problem: 1022 User: cust123 Language: C++ Result: Accepted Time:10 ms Memory:1012 kb****************************************************************/
0 0
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 题目1022:游船出租
- 九度OJ 题目1022:游船出租
- 九度oj 题目1022:游船出租
- 九度OJ 题目1022:游船出租
- 九度 Online Judge 算法 刷题 题目1022:游船出租
- 九度 1022 游船出租
- 九度:1022:游船出租
- HDOJ 题目1861 游船出租(水题)
- (基本不使用这种)springMVC注解
- 远程连接MySQL, 10038问题
- servlet监听完成统计在线人数,显示在线人员列表(附源码)
- openstack的keystone安装运行总结
- 110. Balanced Binary Tree
- 题目1022:游船出租
- Hibernate关联映射——对象的三种关系
- 如何计算两个时间相差多少周年
- PAT-A-1016. Phone Bills (25)
- Singleton单例模式的几种创建方法
- Android 动态支持多语言
- 11.python开源——工程项目结构
- 安装nginx_upstream_check_module时make出错,求助
- 程序员该如何定位