include iostream using namespace std class private int 100 int public

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
using namespace std;
class Q{
private:
int a[100];
int n;
public:
void Enter(){
cout << "Vvedite dlinu massiva" << endl;
cin >> n;
cout << "Vvedite elementi massiva" << endl;
for (int q=0; q<n; q++)
cin >> a[q];
}
void Output(){
cout << endl;
for (int q=0; q<n; q++)
cout << a[q] << " ";
cout << endl;
}
void TaskOutPut(){
for (int q=0; q<n; q = q + 2)
cout << a[q] << " ";
for (int q=1; q<n; q = q + 2)
cout << a[q] << " ";
}
};
int main(){
Q obj;
obj.Enter();
obj.TaskOutPut();
}