将奇数数组与偶数数组合并为一个数组
#include <stdio.h>
int main()
{
int a[10];
int i[10]={0,2,4,6,8};
int j[10]={1,3,5,7,9};
int b,c,d,e;
d=e=5;
c=0;
for(b=0;b<d;b++)
{
a[c]=i[b];
c++;
}
for(b=0;b<e;b++)
{
a[c]=j[b];
c++;
}
printf("\n偶数: ");
for(b=0;b<d;b++)
{
printf("%d ",i[b]);
}
printf("\n 奇数: ");
for(b=0;b<e;b++)
{
printf("%d ",j[b]);
}
printf("\n合并后: ");
for(b=0;b<10;b++)
{
printf("%d ",a[b]);
}
return 0;
}
标签:10,奇数,int,合并,偶数,数组
From: https://www.cnblogs.com/yesiming/p/17467624.html