本文整理汇总了C++中Queue::Output方法的典型用法代码示例。如果您正苦于以下问题:C++ Queue::Output方法的具体用法?C++ Queue::Output怎么用?C++ Queue::Output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Queue
的用法示例。
在下文中一共展示了Queue::Output方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Queue<int> queue;
cout<<"******************************"<<endl;
cout<<"*selet an item "<<endl;
cout<<"*establish a quue,enter'1' " <<endl;
cout<<"*output enter '4' "<<endl;
cout<<"*quit,enter '0' "<<endl;
cout<<"******************************"<<endl;
int i;
do{
cout<<"ÇëÊäÈëÄãµÄÑ¡Ôñ£º";
cout<<"1---> establish¡¢2----game(int)¡¢3----game()¡¢4--->output¡¢0--->quit¡¢"<<endl;
cin>>i;
switch(i)
{
case 1:
cout<<"create a queue"<<endl;
cout<<"please enter the number of the card:"<<endl;
int s,j,Flag ;
Flag=1;
cin>>s;
for(j=1;j<=s;j++){
queue.EnQueue(j,Flag);
}
cout<<"OKey"<<endl;
break;
case 2:
queue.Game(s);
break;
case 3:
cout<<"the result:"<<endl;
queue.Game();
break;
case 4:
cout<<"the members in the queue"<<endl;
queue.Output();
break;
}
}while(i!=0);
return 0;
}
示例2: main
int main()
{
Queue<int> queue;
cout<<"******************************"<<endl;
cout<<"*selet an item "<<endl;
cout<<"*establish a quue,enter'1' " <<endl;
cout<<"*Enqueue,enter '2' "<<endl;
cout<<"*Dequeue enter '3' "<<endl;
cout<<"*quit,enter '0' "<<endl;
cout<<"******************************"<<endl;
int i;
do{
cout<<"ÇëÊäÈëÄãµÄÑ¡Ôñ£º";
cout<<"1---> establish¡¢2----Enqueue¡¢3----Dequeue¡¢4--->output¡¢0--->quit¡¢"<<endl;
cin>>i;
switch(i)
{
case 1:
cout<<"create a queue"<<endl;
cout<<"please enter the number of the queue"<<endl;
int j,s;
cin>>s;
for(j=0;j<s;j++){
cout<<"there is "<<s<<" numbers"<<endl;
cout<<"this is the "<<j+1<<"th number"<<endl;
int m;
cin>>m;
queue.EnQueue(m);
}
cout<<"OKey"<<endl;
break;
case 2:
cout<<"push members into queue:"<<endl;
int n,l;
cout<<"How many member you want to enter:"<<endl;
cin>>n;
for(i=0;i<n;i++){
cout<<"please enter the "<<i+1 <<"th member you want to push:"<<endl;
cin>>l;
queue.EnQueue(l);
}
cout<<"OK"<<endl;
break;
case 3:
cout<<"Dequeue"<<endl;
cout<<"How many member you want to pop"<<endl;
int m;
cin>>m;
for(i=0;i<m;i++){
queue.DeQueue();
}
cout<<"OK";
break;
case 4:
cout<<"the members in the queue"<<endl;
queue.Output();
break;
}
}while(i!=0);
return 0;
}