Advertisement
Nikita051

Untitled

Jun 11th, 2023
951
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <time.h>
  3. using namespace std;
  4.  
  5. int main() {
  6.     srand(time(NULL));
  7.     cout << "Enter count num: ";
  8.     int num;
  9.     cin >> num;
  10.  
  11.     int* pNum = new int[num];
  12.  
  13.     for (int i = 0; i < num; i++) {
  14.         *(pNum + i) = rand() % 100;
  15.         cout << *(pNum + i) << " ";
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement