Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- void tablica(int n, int *tab, int min, int max)
- {
- while(n--)
- *tab++=min+rand()%(max-min+1);
- }
- void wyswietl(int n, int *tab)
- {
- while(n--)
- cout<<*tab++<<" ";
- cout<<endl;
- }
- int main()
- {
- int n=10;
- srand(time(0));
- int a[n];
- tablica(n,a,1,50);
- wyswietl(n,a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement