Advertisement
Kasamundo

Zadanie 2 kartkówka | Wpisywanie randomowych liczb do tabeli

Oct 23rd, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int tab[7];
  9.     srand(time(NULL));
  10.     for(int i=0;i<7;i++)
  11.     {
  12.         tab[i]=rand()%11+15;
  13.         cout << tab[i] << " ";
  14.     }
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement