Advertisement
Guest User

21

a guest
Feb 26th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <time.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     //Zadanie 1
  10.     cout << "~~~Zadanie 1~~~" << endl;
  11.     /*{
  12.         cout << "od 0 do 10:" << endl;
  13.         int tab[10];
  14.         srand(time(NULL));
  15.         for (int i = 0; i < 10; i++)
  16.         {
  17.             tab[i] = rand() % 10 + 0;
  18.             cout << tab[i] << endl;
  19.         }
  20.         return 0;
  21.     }*/
  22.     /*{
  23.         cout << "od 1 do 15:" << endl;
  24.         int tab[10];
  25.         srand(time(NULL));
  26.         for (int i = 0; i < 10; i++)
  27.         {
  28.             tab[i] = rand() % 15 + 1;
  29.             cout << tab[i] << endl;
  30.         }
  31.         return 0;
  32.     }*/
  33.     {
  34.         cout << "od -10 do 10:" << endl;
  35.         int tab[10];
  36.         srand(time(NULL));
  37.         for (int i = 0; i < 10; i++)
  38.         {
  39.             tab[i] = ((rand() % 10) - 10);
  40.             cout << tab[i] << endl;
  41.         }
  42.         return 0;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement