Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a,b,c=0,d=0,x,e[5],o[5];
- for(a=0;a<15;a++)
- {
- scanf("%d",&x);
- if(x%2==0)
- {
- e[c]=x;
- c++;
- if(c==5)
- {
- for(b=0;b<c;b++)
- {
- printf("par[%d] = %d\n",b,e[b]);
- e[b]=0;
- }
- c=0;
- }
- }
- else
- {
- o[d]=x;
- d++;
- if(d==5)
- {
- for(b=0;b<d;b++)
- {
- printf("impar[%d] = %d\n",b,o[b]);
- o[b]=0;
- }
- d=0;
- }
- }
- }
- for(b=0;b<5;b++){if(o[b]==0)break;printf("impar[%d] = %d\n",b,o[b]);}
- for(b=0;b<5;b++){if(e[b]==0)break;printf("par[%d] = %d\n",b,e[b]);}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement