链接:http://pat.zju.edu.cn/contests/pat-a-practise/1008
题意:给出楼层序列计算电梯运行时间。
分析:简单模拟题。
#include<stdio.h> int main() { int n; int count = 0; int cur = 0; int tmp; scanf("%d", &n); while (n--) { scanf("%d", &tmp); if (tmp > cur) { count += (tmp - cur) * 6 + 5; } else if (tmp < cur) { count += (cur - tmp) * 4 + 5; } else count += 5; cur = tmp; } printf("%d\n", count); return 0; }
相关推荐
elevator.js 是一个 "back to top" 按钮,即点击 "back to top" 按钮即可缓慢的返回网页顶部。 示例: [removed] // Elevator script included...elevator.elevate(); [removed] 标签:elevator
elevator.exe
使用java语言实现的elevator模拟程序
电梯群控系统服务质量和运行效能评估软件设计与实现 建立了电梯客流到达模型,然后建立了6种电梯群调度模型
模拟器电梯 模拟建筑物中电梯的使用
algorithm that has been designed by ThyssenKrupp Elevator Company for the express purpose of evacuating mid to high rise buildings and demonstrates the reduced time of egress as opposed to traditional...
this is the java code for elevator which can be applied on elevator operation.
elevator_sim.pro.user
Elevator.dsp
自己编的双电梯软件模拟系统,通过交互的按键界面和状态栏,模拟双电梯的运行状况
简单电梯模拟程序,一个.c文件,版权所有,请于24小时内删除,勿用于商业用途
STM32 mini开发板,实现触摸电梯升降小程序
用cocos2d-x引擎开发的C++电梯模拟调度程序,有可视化的界面。
python库,解压后可用。 资源全名:stix2_elevator-1.0.0-py2.py3-none-any.whl
实现9层电梯控制 功能如下:1,先假设没上楼之前,楼层运行看不到(没图形),可以当做随机看待。 2。当在某层按电梯开关后,在屏幕显示电梯停到该指定楼层的图形状态。 3。随后可以按想去的楼层,在屏幕显示电梯...
采用verilog写的四层电梯控制程序,有相应的图片,报告,容易理解
Java电梯系统,电梯运行状态:从电梯启动时刻,到电梯运动停止时的运行状态,包括上行(UP)和下行(DOWN)状态。此状态电梯速度大于0。(启动时刻,运行停止时刻)。 b)电梯开关门状态:电梯静止时,从门打开时刻(门...
this is a elevator simulator,winform,csharp,and ds