手打队列

· · 个人记录

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int q[30]={0,6,3,1,7,5,2,9,4,8},head=1,tail=10;
    while(head!=tail)
    {
        cout << q[head];
        head++;
        q[tail]=q[head];
        head++;tail++;
    }
    return 0;
}