Untitled
unknown
c_cpp
2 years ago
479 B
6
Indexable
using namespace std;
#include <iostream>
#include <iostream>
#include <stdio.h>
#include <string>
#include <ctime>
void foo(int m[], const int size, int a, int b) {
for (int i = 0; i < size; i++)
{
m[i] = rand() % (b - a + 1) + a;
}
}
int main()
{
srand(time(0));
const int N = 1000;
int mass[N];
int n;
cin >> n;
int a, b;
cin >> a >> b;
foo(mass, n, a, b);
for (int i = 0; i < n; i++)
{
cout << mass[i] << " ";
}
}
Editor is loading...
Leave a Comment