-
Notifications
You must be signed in to change notification settings - Fork 1
/
1179.c
64 lines (53 loc) · 1.14 KB
/
1179.c
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<stdio.h>
int main()
{
int arr[15], par[15], impar[15], i, count1=0, count2=0, j=0, k=0, l;
for(i=0; i<15; i++)
{
scanf("%d", &arr[i]);
if(count1<=5)
{
if(arr[i]%2==0)
{
par[j] = arr[i];
count1++;
j++;
}
if(count1==5)
{
for(l=0; l<5; l++)
{
printf("par[%d] = %d\n", l, par[l]);
}
count1=0, j=0;
}
}
if(count2<=5)
{
if(arr[i]%2!=0)
{
impar[k] = arr[i];
count2++;
k++;
}
if(count2==5)
{
for(l=0; l<5; l++)
{
printf("impar[%d] = %d\n", l, impar[l]);
}
count2=0, k=0;
}
}
}
for(i=0; i<count2; i++)
{
printf("impar[%d] = %d\n", i, impar[i]);
}
for(i=0; i<count1; i++)
{
printf("par[%d] = %d\n", i, par[i]);
}
return 0;
}
/// -7 3