} if (flag == 0) { printf("Are you kidding me?"); } else { for (int i = 0; i < cnt; i++) { if (mid[i] == one_two) printf("1->2\n"); if (mid[i] == three_two) printf("3->2\n"); if (mid[i] == one_three) printf("1->3\n"); } }
structQuene { int node[1001]; int size; int front; int rear; }; typedefstructQueneqe; qe A, B; voidgen() { int all; int n; scanf("%d", &all); A.front = 0; A.rear = 0; A.size = 0;
B.front = 0; B.rear = 0; B.size = 0; int i; for (i = 0; i < all; i++) { scanf("%d", &n); if (n % 2 == 0) { B.node[B.rear] = n; B.rear++; B.size++; } else { A.node[A.rear] = n; A.rear++; A.size++; } } } int top_a1 = 1, top_a2 = 1, top_b = 1; int top; qe Pop(qe q) {
if (q.size > 0) { top = q.node[q.front]; q.size--; q.front++; } else { top = -1; }
return q; }
intmain() { int a1 = 1, a2 = 1, b = 1; int tag = 0; gen(); while (a1 > 0 || a2 > 0 || b > 0) { A = Pop(A); a1 = top; if (top > 0) { if (tag) { printf(" "); } printf("%d", top); tag = 1; }
A = Pop(A); a2 = top; if (top > 0) { if (tag) { printf(" "); } printf("%d", top); tag = 1; } B = Pop(B); b = top; if (top > 0) { if (tag) { printf(" "); } printf("%d", top); tag = 1; }