11247 - Sorting   

Description

This is a partial judge problem , your mission is to read the partial judge code given below

and implement 2 functions: 

    1.void  sort(int a[],int len) 

     --> Sort the disorder integer array in ascending order. ※len = the length of the integer array

    2. void show_the_array(int a[],int len)

      --> Print out the sorted array , and follow the output format ※len = the length of the integer array

Please submit the implementation of these 2 function to NTHU OJ and choose C compiler . 

You have to use this partial judge code to implement the 2 function:

#include<stdio.h>
#include<stdlib.h>
void sort(int a[] , int len);
void show_the_array(int a[] , int len);

int main(void){
    int i,N;
    scanf("%d",&N);
    int *S = malloc(sizeof(int)*N);
    for(i=0;i<N;i++)scanf("%d",S+i);
    sort(S,N);
    show_the_array(S,N);
    return 0;
}

 

Input

The 1st line contains an integer N which indicate the length of the integer array.

The 2nd line contains N integers which are the elements in that array.

Output

Print out the sorted integer array in ascending order.

Note that :

1.There is a "space" between any 2 integers.

2.There is no need to add "\n" at the end of output.

3.There is no need to add "space" at the end of output.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11247.c

Partial Judge Header

11247.h

Tags




Discuss