Problem T: 函数的指针参数:数组排序

Problem T: 函数的指针参数:数组排序

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 118  Solved: 65
[Submit] [Status] [Web Board] [Creator:]

Description

使用自定义函数 void sort(int a[], int n); 对数组a中的整数进行排序(升序) 
函数的参数:a为数组(指针),n为数组中元素的个数 

Input

一组整数(不超过10个),每个整数的绝对值不超过1000,读取到输入结束

Output

按升序输出数组元素的值,每行一个 

Sample Input Copy

3 1 4 1 5 9

Sample Output Copy

1
1
3
4
5
9

HINT

main函数的定义如下 

int main() 

    int a[10],n=0; 
    while( scanf("%d",&a[n])==1 ) n++; 
    sort(a,n); 
    output(a,n); 


其中output也是自定义函数,原型为 void output(int a[], int n); 
函数的功能是输出数组a的前n个元素,每行一个