Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
376 B
0
Indexable
Never
#include <iostream>
using namespace std;

void fill(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 mas[N], a, b;
	int n;
	cin >> n;
	cin >> a >> b;
	fill(mas, n, a, b);
	for (int i = 0; i < n; i++) {
		cout << mas[i] << " ";
	}
}
Leave a Comment