格式修改
This commit is contained in:
parent
d86571bd80
commit
fad43a0246
3 changed files with 13 additions and 3 deletions
|
@ -38,7 +38,7 @@ public:
|
|||
{
|
||||
if (temp[i].back() < come.front())
|
||||
{
|
||||
printf("将车厢%d引入缓冲轨道%d \n", come.front(), i + 1);
|
||||
printf("%d号车厢推入#%d缓冲轨 \n", come.front(), i + 1);
|
||||
temp[i].enqueue(come.dequeue());
|
||||
}
|
||||
else
|
||||
|
@ -60,8 +60,12 @@ public:
|
|||
{
|
||||
if(temp[j].front()==i)
|
||||
{
|
||||
printf("将缓冲轨道%d中的车厢%d引入出发序列\n", j+1,temp[j].front());
|
||||
printf("%d号车厢经#%d缓冲轨推入出发区,出发队列为 ", j+1,temp[j].front());
|
||||
out.enqueue(temp[j].dequeue());
|
||||
for (int i = 0; i < out.size(); i++)
|
||||
printf("%d ", out[i]);
|
||||
printf("\n");
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
Node find(int i);
|
||||
T remove(T i);
|
||||
|
||||
int operator[](int i)
|
||||
T operator[](int i)
|
||||
{
|
||||
Node p = first();
|
||||
while (0 < i--)
|
||||
|
|
|
@ -9,6 +9,12 @@ class Queue
|
|||
private:
|
||||
List<T> q;
|
||||
public:
|
||||
|
||||
T operator[](int i)
|
||||
{
|
||||
return q[i];
|
||||
}
|
||||
|
||||
int size()
|
||||
{
|
||||
return q.size();
|
||||
|
|
Reference in a new issue