Essays.club - Получите бесплатные рефераты, курсовые работы и научные статьи
Поиск

Лабораторная работа по "Информатике"

Автор:   •  Май 27, 2022  •  Лабораторная работа  •  1,024 Слов (5 Страниц)  •  156 Просмотры

Страница 1 из 5

Частное учреждение образования

«Колледж бизнеса и права»

ОТЧЕТ ПО ЛАБОРАТОРНОЙ РАБОТЕ №13

 22.10.2021

Т.095009

Руководитель практики                   А.В.Рогалевич

Учащийся                   Д.С.Капур

   

2021

Общие задания:

Задание 1.

[pic 1]

#include <Windows.h>

#include <iostream>

#include <string>

#include <set>

using namespace std;

int main()

{

    setlocale(0, "rus");

    set<char> ar = { '9','1','8','3','6','5',' ','7',' ',' ' };

    string str, sort = "";

    int teo = 0;

    cout << "Введите строку: ";

    getline(cin, str);

    for (int i = 0; i < str.size(); i++) {

        for (int j = str.size() - 1; j >= i; j--) {

            if (str[j] < str[i]) {

                char t = str[i];

                str[j + 1] = str[j];

                str[j] = t;

            }

        }

        if (ar.count(str[i])){

            sort += str[i];

            teo++;

        }

    }

    str.erase(0, teo);

    sort = str + sort;

    cout << sort;

    cout << endl;

    return 0;

    system("pause");

}

  [pic 2]

Задание 2.

 [pic 3]

#include <algorithm>

#include <iostream>

using namespace std;

int main()

{

    setlocale(0, "rus");

    double mas[10];

    cout << "Введитье массив:\n";

    for (double& a : mas) {

        cin >> a;

    }

    sort(begin(mas), end(mas));

    for (double& a : mas) {

        cout << a << " ";

    }

    cout << endl;

    reverse(begin(mas), end(mas));

    for (double& a : mas) {

        cout << a << " ";

    }

    cout << endl;

    return 0;

    system("pause");

}

[pic 4]

Задание 3.

[pic 5]

#include <algorithm>

#include <iostream>

#include <string>

using namespace std;

...

Скачать:   txt (3.6 Kb)   pdf (130.6 Kb)   docx (82.1 Kb)  
Продолжить читать еще 4 страниц(ы) »
Доступно только на Essays.club