Untitled

 avatar
unknown
plain_text
a year ago
544 B
4
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