Ответ:
#include <iostream>
#include <algorithm>
#include <vector>
#include <ctime>
int main()
{
using namespace std;
srand(time(NULL));
int16_t size = rand() % 20 + 5;
vector<int16_t> vec(size);
for (int16_t i = 0; i < size; i++)
vec[i] = rand() % 50;
cout << vec[i] << "\t";
}
cout << "\n\n";
sort(vec.begin(), vec.end());
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
#include <algorithm>
#include <vector>
#include <ctime>
int main()
{
using namespace std;
srand(time(NULL));
int16_t size = rand() % 20 + 5;
vector<int16_t> vec(size);
for (int16_t i = 0; i < size; i++)
{
vec[i] = rand() % 50;
cout << vec[i] << "\t";
}
cout << "\n\n";
sort(vec.begin(), vec.end());
for (int16_t i = 0; i < size; i++)
{
cout << vec[i] << "\t";
}
return 0;
}