#include using namespace std; struct Qeueue { int container_[1000]; int size_ = 0; int start_ = 0; void push(int n) { if (start_ + size_ == 1000) { for (int i = 0; i < size_; i++) { container_[i] = container_[start_ + i]; } start_ = 0; } container_[size_ + start_] = n; size_++; } int front() { return container_[start_]; } int pop() { int out = front(); start_++; size_--; return out; } int size() { return size_; } void clear() { start_ = 0; size_ = 0; } }; int main() { string command; cin >> command; Qeueue q; while (command != "exit") { if (command == "push") { int n; cin >> n; q.push(n); cout << "ok\n"; } else if (command == "pop") { cout << q.pop() << '\n'; } else if (command == "size") { cout << q.size() << '\n'; } else if (command == "front") { cout << q.front() << '\n'; } else if (command == "clear") { q.clear(); cout << "ok\n"; } cin >> command; } cout << "bye"; return 0; }