У администратора железнодорожных касс имеется информация о свободных местах в поездах на текущие сутки в следующем виде: пункт назначения, время отправления, число свободных мест. Вывести информацию о числе свободных мест в поездах, следующих до заданного пункта назначения- C++(Си)

const int chArrSize = 256;
 
struct strc // Объявление структуры strc
{ 
    char num[chArrSize]; //номер поезда
    char time[9]; //время отправления аля 00:00:00
    int count_free_berth; //кол-во свободных мест
    char destination_station[chArrSize]; //пункт назначения
}; 
 
int main ()
{
    setlocale(LC_ALL, "Russian");
    strc m[100]; // Объявление массива структур m(M'poezdov)
    char destination_station[chArrSize];
    int np;
 
    cout << "Введите кол-во поездов" << endl;
    cin >> np;
 
    cout << "Введите пункт назначения" << endl;
    cin >> destination_station;
 
    for (int i = 0; i < np; i++) // Ввод информации о поездах
    {
        cout << "Введите номер: ";
        cin >> m[i].num;
        cout << "Введите пункт назначения: ";
        cin >> m[i].destination_station;
        cout << "Введите время отправления: ";
        cin >> m[i].time;
 
        cout << "Введите ко-во свободных мест на этом поезде" << endl;
        cin >> m[i].count_free_berth;
    }
 
    for (int i = 0; i < np; i++)
    {
        if (m[i].count_free_berth != 0 && strcmp(destination_station, m[i].destination_station) == 0)
        {
            cout << "Поезд №" << m[i].num
                << ", отправляющийся в " << m[i].time 
                << ", имеет свободных мест: " << m[i].count_free_berth 
                << endl ;
        }
    }
    return 0;
}

17 Thoughts to “У администратора железнодорожных касс имеется информация о свободных местах в поездах на текущие сутки в следующем виде: пункт назначения, время отправления, число свободных мест. Вывести информацию о числе свободных мест в поездах, следующих до заданного пункта назначения- C++(Си)”

  1. Wow, wonderful blog layout! How long have you been running a blog
    for? you made running a blog look easy. The entire glance of your site is great, as well as the content!
    You can see similar here sklep internetowy

  2. What’s up Dear, are you truly visiting this website regularly, if so after that
    you will definitely get good experience.
    I saw similar here: Sklep online

  3. Great post. I will be facing a few of these
    issues as well.. I saw similar here: Sklep internetowy

  4. It’s appropriate time to make a few plans for the
    longer term and it is time to be happy. I have read this post
    and if I may I wish to suggest you some fascinating things or suggestions.
    Perhaps you could write next articles regarding this article.
    I desire to read even more things about it!
    I saw similar here: Sklep online

  5. Appreciating the time and energy you put into your site and
    in depth information you present. It’s great to come
    across a blog every once in a while that isn’t the same outdated
    rehashed information. Fantastic read! I’ve bookmarked your site and I’m including
    your RSS feeds to my Google account. I saw similar here:
    Ecommerce

  6. Hello! Do you know if they make any plugins
    to assist with SEO? I’m trying to get my
    blog to rank for some targeted keywords but I’m not
    seeing very good success. If you know of any please share.
    Thank you! You can read similar art here:
    Dobry sklep

  7. Hello there! Do you know if they make any plugins to assist with
    Search Engine Optimization? I’m trying to get my blog to rank for
    some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Many thanks! You can read similar blog here: Dobry sklep

  8. It’s very interesting! If you need help, look here: ARA Agency

  9. It’s very interesting! If you need help, look here: ARA Agency

  10. Трансформаторная подстанция https://ktpkrun.ru

  11. Hi there! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords
    but I’m not seeing very good success. If you know of any please share.

    Kudos! You can read similar art here: Ecommerce

  12. Howdy! Do you know if they make any plugins to help with Search
    Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m
    not seeing very good results. If you know of any
    please share. Appreciate it! You can read similar
    blog here: Najlepszy sklep

  13. Hello there! Do you know if they make any plugins to assist with Search Engine Optimization?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Kudos! You can read similar text here: Sklep

  14. Good day! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my
    website to rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Kudos! You can read similar article here: Auto Approve List

  15. Hello there! Do you know if they make any plugins to help with
    Search Engine Optimization? I’m trying to get my site to rank
    for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Many thanks! I saw similar blog here: Hitman.agency

  16. Good day! Do you know if they make any plugins to help
    with SEO? I’m trying to get my website to rank for some targeted keywords but
    I’m not seeing very good gains. If you know of any please share.
    Thanks! I saw similar article here: Link Building

  17. Wow, marvelous blog layout! How long have you ever been running
    a blog for? you make running a blog glance easy. The overall
    look of your site is magnificent, let alone the content!

    You can see similar here najlepszy sklep

Leave a Comment