Write C/C++ program which will repeatedly prompt for and read command from the terminal and perform desired action.
The commands to be supported are:

Add an item into the queue at a given priority, e.g.
Priority: 1
Item:item 1
Print the current contents of the queue.
1: item 1, next item, …

9: my item, …
Reverse – toggle the priority order of the queue, e.g.
9: my item, …

1: item 1, next item, …
Remove the highest priority item form the queue and print it, e.g.
Removed: my item

Specifications of the priority queue:
·Items added into queue may have priority in range 0 to 9
·Initially, 0 is the highest priority.
·Within one priority level, items should be maintained as FIFO.
Hints:
· It is not imperative that you complete application.
· Parts of application you did not finished comment:
1.Why did you not implement?
2.How would you implement?

===========================================
C++面试题--(六)#include <stdio.h> 
C++面试题--(六)#include 
<stdlib.h> 
C++面试题--(六)#include 
<string.h> 
C++面试题--(六)
C++面试题--(六)
#define FALSE   0 
C++面试题--(六)
#define TRUE    1 
C++面试题--(六)
C++面试题--(六)typedef 
int     BOOL; 
C++面试题--(六)
}

相关文章: