-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1179 - Array Fill IV.cpp
More file actions
43 lines (38 loc) · 874 Bytes
/
Copy path1179 - Array Fill IV.cpp
File metadata and controls
43 lines (38 loc) · 874 Bytes
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
40
41
42
43
#include <iostream>
using namespace std;
int main()
{
int a ,e[5] , o[5] , m =0 , n = 0;
for(int i = 0 ; i < 15 ; i++){
cin >> a;
if(a%2 == 0){
e[m] = a;
m++;
}
else{
o[n] = a;
n++;
}
if(m == 5 ){
for(int j = 0; j <5 ; j++){
printf("par[%d] = %d\n" , j , e[j]);
}
m = 0;
}
if(n == 5 ){
for(int j = 0; j <5 ; j++){
printf("impar[%d] = %d\n" , j , o[j]);
}
n = 0;
}
if(i == 14 ){
for(int j = 0; j < n ; j++){
printf("impar[%d] = %d\n" , j , o[j]);
}
for(int j = 0; j < m ; j++){
printf("par[%d] = %d\n" , j , e[j]);
}
}
}
return 0;
}