Untitled
unknown
plain_text
2 years ago
544 B
16
Indexable
#include <iostream>
#include <string.h>
#include <cstdlib>
using namespace std;
void foo(int mas[], const int size, int& n, int &a, int &b) {
srand(time(NULL));
int i = 0;
while (i < n) {
mas[i] = rand() % (b - a + 1) + a;
i++;
}
}
int main(){
int mas[100];
int n;
int a, b;
cin >> n;
cin >> a >> b;
const int size = 100;
int i = 0;
foo(mas, size, n, a, b);
while (i < n) {
cout << mas[i] << endl;
i++;
}
return 0;
}Editor is loading...
Leave a Comment