Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //Createad by Jefferson Carlos
- //Graduando em Eng. da Computaรงรฃo - 2016.1 - UFPE
- int main(){
- 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;
- for(k = 0; k < 15; k++){
- scanf("%d", &x[k]);
- }
- for(z = 0; z < 15; z++){
- if(x[z]%2 == 0){
- for(l = count; l < 6; l++){
- pares[l] = x[z];
- }
- count++;
- }
- if(count == 5){
- for(y = 0; y < 5; y++)
- printf("par[%d] = %d\n", y+1, pares[y]);
- }
- }
- for(c = 0; c < 15; c++){
- if(x[c]%2 != 0){
- for(j = count1; j < 6; j++){
- impares[j] = x[c];
- }
- count1++;
- }
- if(count1 == 5){
- for(h= 0; h < 5; h++)
- printf("impares[%d] = %d\n", h+1, impares[h]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement