卡片游戏
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> const int MAXN = 50; int queue[MAXN]; int main() { int n,front,rear; scanf_s("%d",&n,sizeof(n)); for(int i = 0; i < n; i++) queue[i] = i+1; front = 0, rear = n; while(front < rear) { printf("%d",queue[front++]); queue[rear++] = queue[front++]; } system("pause"); return 0;