Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- setlocale(0, "");
- int n = 0, a = 0, d = 0;
- cout << "Введіть розмір масиву: ";
- cin >> n;
- int* arr = new int[n];
- cout << "\na = ";
- cin >> a;
- arr[0] = a;
- cout << "\nd = ";
- cin >> d;
- for (int i = 1; i < n; i++) {
- arr[i] = arr[i - 1] * d;
- }
- for (int i = 0; i < n; i++) {
- cout << arr[i] << "\t";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment