1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课内】10.函数1/6-3 数据排序.md

43 lines
727 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 6-3 数据排序
输入n<10个整数用任一排序算法按从小到大排序后输出
### 函数接口定义:
```c
在这里描述函数接口。例如:
void fun(int a[], int n);
```
### 裁判测试程序样例:
```c
在这里给出函数被调用进行测试的例子。例如:
#include <stdio.h>
void fun(int a[], int n);
int main()
{int i,a[10],n;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
fun(a,n);
for(i=0;i<n;i++)
printf("%3d",a[i]);
printf("\n");
return 0;
}
/* 请在这里填写答案 */
```
输入格式先输入n值再输入要排序的n个数据
### 输入样例:
```in
6
3 5 4 6 2 1
```
### 输出样例:
```out
1 2 3 4 5 6
```