FHY include stdafx include iostream include conio using namespace std

 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
37
38
39
// FHY
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
const int n = 10;
int x[n], y[n], z[n];
cout << "Enter array: ";
for (int i = 0; i < n; i++)
cin >> x[i];
int k = 0, f = 0;
for (int i = 0; i < n; i++)
{
if (x[i] % 2 == 0)
{
y[k] = x[i];
k++;
}
if (x[i] % 5 == 0)
{
z[f] = x[i];
f++;
}
}
cout << "\nMassiv parnyh el: ";
for (int i = 0; i < k; i++)
cout << y[i] << " ";
cout << "\nMassiv kratnyh 5: ";
for (int i = 0; i < f; i++)
cout << z[i] << " ";
_getch();
return 0;
}