C语言
文章平均质量分 63
蒻鸡琪
这个作者很懒,什么都没留下…
展开
-
操作系统售票员与乘客
设计要求:编程序模拟车站售票厅进程同步问题,售票厅任何时刻最多可容纳20名购票者进入,否则需要在外面等待。每个购票者可以看成一个进程。售票厅任何时刻最多可容纳20名购票者进入,当售票大厅超过20人时,系统提示乘客需退出大厅等待;当大厅中人数少于或等于20人时,售票员开始售票,并提示等待的乘客进入大厅;由于售票大厅是缓存区,最大容量为20,因此会出现3中情况:① 若此时售票厅里人数为零时,则程序会提醒售票大厅为空,售票员的进程阻塞,直到购票者的进程运行完才唤醒该进程;② 当进入售票厅内的人数.原创 2020-06-12 11:44:53 · 4019 阅读 · 14 评论 -
逃离迷宫(bfs+判断转方向的次数)
题目:给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能转太多弯了,否则她会晕倒的。我们...原创 2018-08-05 20:12:44 · 461 阅读 · 0 评论 -
报数游戏
题意:从1到n,再从n到1,依次报数,但是标记其中是7的倍数或含7的的数字的报数,求出m是标记k次的报数是多少?列表内容 思路:反正我是找规律,找出m时报的数,再判断是否符合条件(标记的条件) 如果m=1或者m=n时,那么每个相隔n*2-2; 如果不是的话,那么就先相隔(n-m)*2,然后相隔m*2-2; ...原创 2018-08-04 19:46:02 · 609 阅读 · 0 评论 -
Catch That Cow
题目:Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ ...原创 2018-08-07 20:53:11 · 138 阅读 · 0 评论 -
Find The Multiple(找到倍数)——bfs
题目:Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and ...原创 2018-08-08 08:55:05 · 265 阅读 · 0 评论 -
Prime path(BFS)
题目:The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter ...原创 2018-08-08 19:33:12 · 139 阅读 · 0 评论 -
Shuffle'm Up
题目:A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chip...转载 2018-08-08 20:39:28 · 214 阅读 · 0 评论