#include <iostream>
#include <cmath>
int main() {
int size;
std::cout << "Podaj rozmiar tablicy: ";
std::cin >> size;
int* array = new int[size];
for (int i = 0; i < size; i++) {
array[i] = pow(-2, i);
}
std::cout << *(array + i) << " ";
delete[] array;
return 0;
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2025 KUDO.TIPS - All rights reserved.
#include <iostream>
#include <cmath>
int main() {
int size;
std::cout << "Podaj rozmiar tablicy: ";
std::cin >> size;
int* array = new int[size];
for (int i = 0; i < size; i++) {
array[i] = pow(-2, i);
}
for (int i = 0; i < size; i++) {
std::cout << *(array + i) << " ";
}
delete[] array;
return 0;
}