Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- int N;
- cout << "Введите число элементов " << endl;
- cin >> N;
- int *a= new int [N];
- cout << "Введите элементы массива .Выведите четные индексы массива " << endl;
- for (int i = 0; i < N; i++)
- {
- cin >> a[i];
- }
- for (int i = 0; i < N; i++)
- {
- if (i % 2 == 0)
- {
- cout << "Номер четных индексов " << i << " ";
- cout << "А сами элементы " << a[i] << " " << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement