Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct Poezda {
- int numb;
- char* city;
- char* city1;
- double chasv;
- double chasp;
- };
- int main()
- {
- struct Poezda mass[4], *point = &mass[0];
- int find = 4;
- mass[0].numb = 3244;
- mass[1].numb = 5677;
- mass[2].numb = 4589;
- mass[3].numb = 6734;
- mass[0].city = "Odessa";
- mass[1].city = "Kiyv";
- mass[2].city = "Lviv";
- mass[3].city = "Donetsk";
- mass[0].city1 = "Kharkiv";
- mass[1].city1 = "Kharkiv";
- mass[2].city1 = "Kharkiv";
- mass[3].city1 = "Kharkiv";
- mass[0].chasv = 8.00;
- mass[1].chasv = 9.00;
- mass[2].chasv = 10.00;
- mass[3].chasv = 7.00;
- mass[0].chasp = 14.00;
- mass[1].chasp = 16.00;
- mass[2].chasp = 22.00;
- mass[3].chasp = 13.00;
- std::cout << "Vvedite chas pribitiya" << std::endl;
- double chas;
- std::cin >> chas;
- for (int i = 0; i < 4; i++, point++)
- {
- if (((*point).chasp) == chas)
- {
- std::cout << " Nomer poezda " << ((*point).numb) << std::endl << "Marshrut " << ((*point).city) << ((*point).city1) << std::endl << std::endl <<
- (*point).chasv << std::endl << ((*point).chasp) << std::endl;
- }
- else {
- find--;
- }
- if (find == 0) {
- std::cout << "Net takogo poezda" << std::endl;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement