Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- void array_print(int* array)
- {
- for(int i = 0; i < 6; ++i)
- cout << array[i] << '\t';
- cout << endl;
- }
- bool is_repeating(int* array, int number, int n)
- {
- for(int i = 0; i < n; ++i)
- if(array[i] == number)
- return true;
- return false;
- }
- void fill_array(int* array)
- {
- srand(time(nullptr));
- // rand() - returns a drawn number from interval <1; 32767>
- for(int i = 0; i < 6; ++i)
- array[i] = 1 + rand() % 50;
- }
- int main()
- {
- int arr[6];
- fill_array(arr);
- array_print(arr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement