Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- using namespace std;
- int main() {
- int n;
- cout << "Wprowadź ilość liczb do wylosowania: ";
- cin >> n;
- int tab[n];
- int zakres = 50 + 38 + 1; // max - min + 1
- srand(time(NULL));
- for(int i=0; i<n; i++) {
- tab[i] = (rand() % zakres - 38);
- }
- for(int i=0; i<n; i++) {
- cout << "tab[" << i << "] = " << tab[i] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement