一个长度为N并同时存在偶数和奇数的数组,将所有的奇数排在偶数前面

学习 时间:2026-03-31 17:35:28 阅读:4474
一个长度为N并同时存在偶数和奇数的数组,将所有的奇数排在偶数前面如{1,4,5,2,6,8,7}编程实现成{1,5,7,4,2,6,8}

最佳回答

机灵的月亮

怕孤单的洋葱

2026-03-31 17:35:28

//C语言实现
#include
int main()
{
int a[1000];
int b[1000];
int n;
int i,j=0;
printf("Please input the number of the array:\n");
scanf("%d",&n);
for(i=0;i

最新回答共有2条回答

  • 神勇的小蚂蚁
    回复
    2026-03-31 17:35:28

    //C语言实现 #include int main() { int a[1000]; int b[1000]; int n; int i,j=0; printf("Please input the number of the array:\n"); scanf("%d",&n); for(i=0;i

上一篇 1.x²-根号3-四分之一=0

下一篇 People living in cold climate perfer to 中为什么用living