Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_CTYPE, "");
- int n;
- cin >> n;
- int* A = new int [n];
- for (int i = 0; i < n; i++)
- {
- A[i] = 20 + rand() % 27;
- }
- for (int i = 0; i < n; i++)
- {
- cout << A[i] << " ";
- }
- A[6] = A[5] + A[7];
- cout << "\n\n";
- for (int i = 0; i < n; i++)
- {
- cout << A[i] << " ";
- }
- delete[] A;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment