Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- #include <queue>
- #include <string>
- using namespace std;
- class Ticket{
- public:
- string name;
- string ID;
- unsigned int birthyear;
- Ticket(string new_name, string new_ID, unsigned int new_birthyear)
- {
- name = new_name;
- ID = new_ID;
- birthyear = new_birthyear;
- }
- };
- queue<Ticket> Waiting_list;
- void add_new_waiting(string new_name, string new_ID, unsigned int new_birthyear);
- Ticket get_front();
- int main()
- {
- add_new_waiting("NGUYEN VAN A", "0010", 1990);
- cout << get_front().name<<'\n';
- cout << get_front().ID << '\n';
- cout << get_front().birthyear << '\n';
- }
- void add_new_waiting(string new_name, string new_ID, unsigned int new_birthyear)
- {
- Ticket new_person(new_name, new_ID, new_birthyear);
- Waiting_list.push(new_person);
- }
- Ticket get_front()
- {
- return Waiting_list.front();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement