#include #include "queue.h" #include using namespace std; int main() { ifstream in("input.txt"); ofstream out("output.txt"); Queue getNumb; int x,i; cin >> x; while (in>>i) { getNumb.Put(i); } while (!getNumb.Empty()) { if (x != getNumb.Get()) { out << getNumb.Get() << " "; } in.close(); out.close(); return 0; } } using namespace std; template class Queue { private: struct Element { Item inf; Element *next; Element(Item x) : inf(x), next(0) {} }; Element *head, *tail; public: Queue() : head(0), tail(0) {} bool Empty() { return head == 0; } Item Get() { if (Empty()) { return 0; } else { Element *t = head; Item i = t->inf; head = t->next; if (head == 0) tail = 0; delete t; return i; } } void Put(Item data) { Element *t = tail; tail = new Element(data); if (!head) { head = tail; } else { t->next = tail; } } };