-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1179.cpp
More file actions
44 lines (39 loc) · 811 Bytes
/
1179.cpp
File metadata and controls
44 lines (39 loc) · 811 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
44
#include <iostream>
using namespace std;
int main()
{
int a1[10],a2[5];
for(int i=0;i<10;i++){
cin>>a1[i];
}
for(int i=0;i<5;i++){
cin>>a2[i];
}
for(int i=0,j=0;i<10;i++,j++){
if(a1[i]%2==0){
cout<<"par["<<j<<"] = "<<a1[i]<<endl;
if(j==5){
break;
}
}
}
for(int i=0,j=0;i<10;i++,j++){
if(a1[i]%2!=0&&j!=5){
cout<<"impar["<<j<<"] = "<<a1[i]<<endl;
if(j==5){
break;
}
}
}
for(int i=0;i<5;i++){
if(a2[i]%2!=0){
cout<<"impar["<<i<<"] = "<<a2[i]<<endl;
}
}
for(int i=0;i<5;i++){
if(a2[i]%2==0){
cout<<"par["<<i<<"] = "<<a2[i]<<endl;
}
}
return 0;
}