#include <stdio.h>

int docs[100] = {};
int f = 0;
int r = 0;

void enque(int x){
    docs[r++] = x;
}

int deque(){
    return docs[f++];
}

int empty(){
    return r==f;
}

int size(){
    return r-f;
}

int main() {
    for (int i = 1;i <= 6;i++) {
        enque(i);
    }

    while (size() > 1) {
        deque();
        enque(deque());
    }

    printf("%d", deque());
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: