1.特判1的情况
2.注意空格。。。。
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int n;
while(scanf("%d",&n)&&n!=0)
{
queue<int> cards;
for (int i=0;i<n;i++)
cards.push(i+1);
int first=1;
while(cards.size()!=1)
{
int reng=cards.front();
cards.pop();
int huan=cards.front();
cards.push(huan);
cards.pop();
if(first)
{
first=0;
printf("Discarded cards:%d",reng);
}
else
printf(",%d",reng);
}
printf("\n");
printf("Remaining card:%d\n",cards.front());
}
return 0;
}