CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - tip
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - tip - List
[
Console
]
PARK
DL : 0
设停车场是一个可停放n辆车的狭长通道,且只有一个大门可供汽车进出。在停车场内,汽车按到达的先后次序,由北向南依次排列(假设大门在最南端)。-Parking lots is a car parked n the narrow channel, and only one gate for vehicle access. In the parking lot, the car arrived at the order, from north to south in order of priority (assuming the door at the southern tip.)
Date
: 2025-12-23
Size
: 2kb
User
:
Chunhui
[
Console
]
my-parking
DL : 0
本代码实现的是一个简单的停车场管理系统。设停车场是一个可停放n辆汽车的狭长通道,且只有一个大门可供汽车进出。 汽车在停车场内按车辆到达时间的先后顺序,依次由北向南排列(大门在最南端,最先到达的第一辆车停放在停车场的最北端),若车场内已停满n辆汽车,则后来的车只能在门外的便道上等候,一旦有车开走,则排在便道上的第一辆车即可开入;当停车场内某辆汽车要离开时,在它之后进入的车辆必须退出车场为它让路,待该车辆开出大门外,其他车辆再按原次序进入车场,每辆停放在停车场的车在它离开停车场时必须按它停留时间的长短缴纳费用。试为停车场编制按上述要求进行管理的模拟程序。 基本要求为: 以栈模拟停车场,以队列模拟车场外的便道,按照从终端读入的输入序列进行模拟管理。每一组输入数据包括三个数据项:汽车“到达”或“离去”信息、汽车牌照号码以及到达或离去的时刻。对每一组输入数据进行操作后的输出信息为:若是车辆到达,则输出汽车在停车场内或便道上的停车位置;若是车辆离去,则输出汽车在停车场内停留的时间和应缴纳的费用(在便道上停留的时间不收费)。栈以顺序结构实现,队列以链表结构实现。-The implementation of the code is a simple car park management system. Suppose the parking is parked cars n the narrow channel, and only one door and out of cars. The arrival time of car in the car park by vehicle, followed by narrow (the door first to arrive at the southernmost tip of the first car in the garage, the northernmost), if the car floor is full of parked cars n , later the car can only wait on the sidewalk outside, once the car drove off, came in the first car on the sidewalk to open into when the parking of a vehicle to leave it incoming vehicles must exit the yard to make way for it to be the vehicle out outside the gate, other vehicles into the yard and then the original order, every car parked in the parking lot when it left the parking lot must stay the length of time to pay costs . Test according to the above requirements for the preparation of parking management simulation program. The basic requirements are: The stack analog Parking, to queue simulation car off
Date
: 2025-12-23
Size
: 237kb
User
:
丁洁琼
[
Console
]
CX
DL : 0
设计一个按优先数调度算法实现处理器调度的程序 提示: (1)假定系统有5个进程,每个进程用一个PCB来代表。PCB的格式为: 进程名、指针、要求运行时间、优先数、状态。 进程名——P1~P5。 指针——按优先数的大小把5个进程连成队列,用指针指出下一个进程PCB的首地址。 要求运行时间——假设进程需要运行的单位时间数。 优先数——赋予进程的优先数,调度时总是选取优先数大的进程先执行。 状态——假设两种状态,就绪,用R表示,和结束,用E表示。初始状态都为就绪状态。 (2) 每次运行之前,为每个进程任意确定它的“优先数”和“要求运行时间”。 (3) 处理器总是选队首进程运行。采用动态改变优先数的办法,进程每运行1次,优先数减1,要求运行时间减1。 (4) 进程运行一次后,若要求运行时间不等于0,则将它加入队列,否则,将状态改为“结束”,退出队列。 (5) 若就绪队列为空,结束,否则,重复(3)。 -Design a number of priority scheduling algorithm processor scheduling program   Tip : ( 1 ) The system has five processes, each represented by a PCB . PCB format: Process name , pointer, run-time requirements , priority number , status. Process name- P1 ~ P5. Pointer- according to the size of the five priority number into程连成queue pointer pointed to the next process PCB first address . The time required to run- assuming unit time required to run several processes . Priority number- the number of priority given to the process , always select a large number of priority scheduling process executed first . State- assuming two states , Ready, represented by R , and end with E said . The initial state are ready state. ( 2 ) Before each run , for each process arbitrarily determine its " priority number " and " run-time requirements ." ( 3 ) the processor is always selected first team processes running . Change the priority number of dynamic way to run a process every time , prior
Date
: 2025-12-23
Size
: 1kb
User
:
David Quan
[
Console
]
hannuota
DL : 0
c语言实现汉诺塔,有三根杆子A,B,C。A杆上有N个(N>1)穿孔圆盘,盘的尺寸由下到上依次变小。要求按下列规则将所有圆盘移至C杆:提示:可将圆盘临时置于B杆,也可将从A杆移出的圆盘重新移回A杆,但都必须尊循上述两条规则。问:如何移?最少要移动多少次?-c language HANOR has three poles A, B, C. A bar there are N (N> 1) perforated disk, the disk size bottom to top smaller. Required by the following rules will bar all the disc move to C: Tip: You can put the disc provisional pole B, can also be removed the A lever A lever disc to move back again, but they must respect through the above two rules . Q: How do shift? At least to move many times?
Date
: 2025-12-23
Size
: 185kb
User
:
刘大将
[
Console
]
lab02
DL : 0
f(n)=f(n-1)+f(n-2) f(0)=f(1)=1,求斐波那契数列第20项,分别用循环和递归的方式,比较时间效率。提示:可以使用c函数clock取出当前系统时间,计算前后各一次,两次相减除以每秒的时钟数,就可以得到以秒为单位的差距-f (n) = f (n-1)+ f (n-2) f (0) = f (1) = 1, Item 20 seeking Fibonacci number Fibonacci sequence that were circulating and recursively, more time effectiveness. Tip: You can use the c function Remove the current system clock time, before and after the calculation each time, twice per second relative to the clock deduction, you can get in seconds gap
Date
: 2025-12-23
Size
: 2.42mb
User
:
龙晓聪
[
Console
]
Class-Date
DL : 0
Date类,其成员变量有:年、月、日,成员函数有:输出日期函数、设置日期函数、判读平年与润年函数和日期加1函数。 提示:日期加1得到第二天的日期,有三种情况: 1) 最平常的,直接+1; 2) 一个月的最后一天: a) 一个月是31天; b) 一个月是30天; c) 一个月28天,29天(闰年); 3) 一年的最后一天。 -Date class whose member variables are: year, month, day, member functions are: output date function, set the date function, and interpretation of leap year and leap year date plus 1 function function. Tip: Add 1 to get the date of the next day' s date, there are three cases: 1) the most common, direct+1 2) the last day of the month: a) one month is 31 days b) a month is 30 days c ) month of 28 days, 29 days (leap year) 3) the last day of the year.
Date
: 2025-12-23
Size
: 1kb
User
:
HiJune
[
Console
]
QKWPC
DL : 0
获取磁盘的剩余空间,这对做磁盘归档方面的开发者有点提示作用-Disk for the remaining space, this to the developers of the disk file is a little tip
Date
: 2025-12-23
Size
: 10kb
User
:
mim@87424
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.