Advertisement
JCLC

JCLC

May 4th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.     int pares[5] = { 0 }, impares[5] = { 0 }, z = 0, y = 0, j = 0, c = 0, h = 0, x[15] = { 0 }, k = 0, count = 0, count1 = 0, l = 0, o = 0;
  5.  
  6.         for(k = 0; k < 15; k++){
  7.             scanf("%d", &x[k]);
  8.         }
  9.  
  10.         for(z = 0; z < 15; z++){
  11.             if(x[z]%2 == 0){
  12.                 for(l = count; l < 6; l++){
  13.                 pares[l] = x[z];
  14.                 }
  15.                 count++;
  16.             }
  17.             if(count == 5){
  18.             for(y = 0; y < 5; y++)
  19.                printf("par[%d] = %d\n", y+1, pares[y]);
  20.             }
  21.         }
  22.  
  23.         for(c = 0; c < 15; c++){
  24.             if(x[c]%2 != 0){
  25.                 for(j = count1; j < 6; j++){
  26.                 impares[j] = x[c];
  27.                 }
  28.                 count1++;
  29.             }
  30.             if(count1 == 5){
  31.             for(h= 0; h < 5; h++)
  32.                printf("impares[%d] = %d\n", h+1, impares[h]);
  33.             }
  34.         }
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement