• Aug 27, 2024 •vercetti322
0 likes • 5 views
#include <iostream> #include <vector> #include <algorithm> #include <cstdlib> #include <ctime> using namespace std; // Function to generate random numbers vector<int> generateRandomNumbers(int count, int minValue, int maxValue) { vector<int> numbers; for (int i = 0; i < count; ++i) { numbers.push_back(rand() % (maxValue - minValue + 1) + minValue); } return numbers; } // Function to print a vector of integers void printVector(const vector<int>& vec) { for (int num : vec) { cout << num << " "; } cout << endl; } // Function to sort and display numbers void sortAndDisplayNumbers(vector<int>& numbers) { sort(numbers.begin(), numbers.end()); cout << "Sorted numbers: "; printVector(numbers); } int main() { // Seed the random number generator srand(static_cast<unsigned int>(time(0))); int count, minValue, maxValue; cout << "Enter the number of random numbers to generate: "; cin >> count; cout << "Enter the minimum value: "; cin >> minValue; cout << "Enter the maximum value: "; cin >> maxValue; // Generate random numbers vector<int> numbers = generateRandomNumbers(count, minValue, maxValue); // Display unsorted numbers cout << "Unsorted numbers: "; printVector(numbers); // Sort and display sorted numbers sortAndDisplayNumbers(numbers); return 0; }
• Jan 10, 2025 •alexandr.zaikin.9999-c10d
0 likes • 2 views
import os
• Oct 31, 2021 •aedrarian
0 likes • 3 views
##README: Rename file to "data" (no extension) and delete this line 4 4.55 5 5.70 6 6.80 7 7.95 8 9.10 9 10.20 10 11.35 11 12.50 12 13.60 13 14.75 14 15.90 15 17 16 18.15 17 19.30 18 20.40 19 21.55 20 22.70 21 23.80 22 24.95 23 26.10 24 27.25 25 27.80 26 28.95 27 30.10 28 31.20 29 32.35 30 33.50 35 39.15 40 44.80 45 50.50 50 55.60 60 67 70 78.30 75 83.45 80 89.10 90 100.45 100 111.25 125 139 150 166.85 200 222.50
• Jun 1, 2025 •abeRodrz99
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> </body> </html>
• May 13, 2025 •rejordon17-9956
0 likes • 1 view
fsdfsdfsdf
• Apr 26, 2025 •C S
[*.cs] indent_style = space indent_size = 2 tab_width = 2 csharp_new_line_before_open_brace = none