Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- using namespace std;
- class Bus
- {
- public:
- void fillData(); //ввод данных
- void showData(); //ввывод данных
- private:
- char start[32]; // название начального пункта маршрута
- char end[32]; // название конечного пункта маршрута
- char bus[32]; // номер маршрута
- };
- int main()
- {
- setlocale(LC_ALL, "rus");
- Bus first;
- Bus second;
- Bus Third;
- Bus fourth;
- Bus fith;
- cout << "Внесите данные\n";
- first.fillData();
- second.fillData();
- Third.fillData();
- fourth.fillData();
- fith.fillData();
- first.showData();
- second.showData();
- Third.showData();
- fourth.showData();
- fith.showData();
- return 0;
- }
- void Bus::fillData()
- {
- cout << "название начального пункта маршрута: ";
- cin.getline(start, 32);
- cout << "название конечного пункта маршрута: ";
- cin.getline(end, 32);
- cout << "номер маршрута: ";
- cin.getline(bus, 32);
- }
- void Bus::showData()
- {
- cout << "название начального пункта маршрута: " << start <<"название конечного пункта маршрута: " << end << "номер маршрута: " << bus << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement