Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
544 B
1
Indexable
Never
#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;

}
Leave a Comment