#include <iostream>
#include <random>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <chrono>
using namespace std;
void puzer() {
    const int SIZE = 1000;
    vector<int> arr(SIZE);

    random_device rd;
    mt19937 gen(rd());
    uniform_int_distribution<> dist(1, 10000);
    for (int& num : arr) num = dist(gen);

    auto start = std::chrono::steady_clock::now();

    for (int i = 0; i < SIZE-1; ++i) {
        for (int j = 0; j < SIZE-i-1; ++j) {
            if (arr[j] > arr[j+1]) swap(arr[j], arr[j+1]);
        }
    }

    auto end = std::chrono::steady_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
    cout << "2. Время сортировки: " << duration.count() << " мкс" << endl;
}





int main() { puzer(); }
