SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <ctime>
  3. using namespace std;
  4.  
  5. int main() {
  6.   int n;
  7.   cout << "Wprowadź ilość liczb do wylosowania: ";
  8.   cin >> n;
  9.   int tab[n];
  10.   int zakres = 50 + 38 + 1; // max - min + 1
  11.   srand(time(NULL));
  12.   for(int i=0; i<n; i++) {
  13.         tab[i] = (rand() % zakres - 38);
  14.   }
  15.   for(int i=0; i<n; i++) {
  16.         cout << "tab[" << i << "] = " <<  tab[i] << endl;
  17.   }
  18.   return 0;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top