Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctime>
- #include <iostream>
- using namespace std;
- const int N = 100;
- void inp_array(int* x, int n);
- void out_array(int* x, int n);
- void inp_array_rand(int* x, int n);
- void main() {
- int n, a[N];
- cin >> n;
- if (n<1 || n>N) {
- cout << "ERROR Size\n";
- return;
- }
- out_array(a, n);
- inp_array_rand(a, n);
- }
- void inp_array(int* x, int n) {
- cout << "Vvedite" << n << "chisel\n";
- for (int i = 0; i < n; i++)
- cin >> x[i];
- }
- void out_array(int* x, int n) {
- cout << "\n massiv chisel\n";
- for (int i = 0; i < n; i++)
- cout << x[i] << " ";
- cout << endl;
- }
- void inp_array_rand(int* x, int n) {
- srand(time(0));
- for (int i = 0; i < n; i++) {
- x[i] = rand() % 56;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement