题目:
交叉排序
Time Limit: 1000 ms Memory Limit: 32768 KiB
Submit Statistic Discuss
Problem Description
输入N个数,把所有奇数位置上的数从小到大排序,把偶数位置上的数从大到小排序。
Input
输入的第一行是一个正整数N(2<=N<=100)。
第二行是N个用空格隔开的整数。
Output
输出只有一行N个数,是按要求排序后的序列,用空格隔开。
Sample Input
6
1 2 3 4 5 6
Sample Output
1 6 3 4 5 2
Hint
解题代码
#include<stdio.h>
#include<stdlib.h>
#define max 1001
int c[max],a[max],b[max],d[max];
void mergesort(int s1,int e1,int s2,int e2)
{
int k=0;
int i=s1,j=s2;