nefu 1632 周末舞会-队列![在这里插入图片描述](https://img-blog.csdnimg.cn/20200114152058952.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob3VjaGVuZ18xMjM=,size_16,color_FFFFFF,t_70)
熟悉语法题,不难
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m,n,k;
cin>>n>>m>>k;
queue<int>q1,q2;
for(int i=1;i<=n;i++)q1.push(i);
for(int i=1;i<=m;i++)q2.push(i);
while(k--)
{
cout<<q1.front()<<" "<<q2.front()<<endl;
q1.push(q1.front());
q2.push(q2.front());
q1.pop();
q2.pop();
}
return 0;
}
nefu 1633 取牌游戏-队列
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200114152318100.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3pob3VjaGVuZ18xMjM=,size_16,color_FFFFFF,t_70)
熟练语法题,不难
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m,n,k,p,i;
cin>>n>>k>>p;
queue<int>q;
int a[10005];
for(i=1;i<=k;i++)q.push(i);
i=1;
int ans=0;
while(!q.empty())
{
if(i%n==0){
a[ans]=q.front();ans++;} q.pop();
i++;
for(int