Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<ctime>
- using namespace std;
- void main()
- {
- srand(time(NULL));
- setlocale(LC_ALL, "RUS");
- int a;
- cin >> a;
- int* arr_1 = new int[a];
- int* arr_2 = new int[a];
- cout << "Первый массив"<<endl;
- for (int c = 0; c < a; c++) {
- arr_1[c] = rand() % 9;
- cout << arr_1[c] << " ";
- }
- cout << endl << "второй массив"<<endl;
- for (int c = 0; c < a; c++)
- {
- arr_2[c] = rand() % 9;
- cout << arr_2[c] << " ";
- }
- cout <<endl<< "СУММА" << endl;
- int* sum_of = new int[a];
- for (int c = 0; c < a; c++)
- {
- sum_of[c] = arr_1[c] + arr_2[c];
- cout << sum_of[c] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement