You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
351 B

#include<iostream>
using namespace std;
struct queue {
int data[100];
int head;
int tail;
};
int main() {
struct queue q;
int i;
q.head=1;
q.tail=1;
for(i=1; i<=9; i++) {
cin>>q.data[q.tail];
q.tail++;
}
while(q.head<q.tail) {
cout<<q.data[q.head];
q.head++;
q.data[q.tail]=q.data[q.head];
q.tail++;
q.head++;
}
return 0;
}