Guest User

Untitled

a guest
May 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. void zapelnij(int *tab)
  6. {
  7.      for (int i=0;i<5; i++)
  8.      {
  9.          *(tab+i)=rand()%10;
  10.      }
  11. }
  12.          
  13. void wyswietl(int *tab)
  14. {
  15.      for (int i=0;i<5;i++)
  16.      {
  17.          cout<<*(tab+i)<<" ";
  18.      }
  19. }    
  20.  
  21. int main()
  22. {
  23.    srand(time(NULL));
  24.    int tab[5];
  25.    zapelnij(tab);
  26.    wyswietl(tab);
  27.    cin.ignore();
  28.    getchar();
  29.    return 0;    
  30. }
Add Comment
Please, Sign In to add comment