当前位置:网站首页>ZZULIOJ:1119: sequence order
ZZULIOJ:1119: sequence order
2022-07-30 22:56:00 【catch up】
1119: 1D array sorting
Time limit: 1 Sec Memory limit: 128 MB
[Status] [Discussion Board] [Submit] [Submit by:admin]
Title description
Sort one-dimensional arrays in ascending order.The program defines the function sort() to sort the array a.The function prototype is as follows:
void sort(int a[], int n);
The output of an array element calls PrintArr().
Enter
Enter an integer n (1<=n<=10) in the first line, indicating that the array has n integers; input n integers in the second line.
Output
The output is on one line.Output the n integer numbers in ascending order, and separate the data with a space.
Sample input Copy
66 5 1 2 3 4
Sample output Copy
1 2 3 4 5 6
Reference code
#include #include #define N 10void sort(int a[],int n);void PrintArr(int a[], int n);int main(){int a[N];int n, i;scanf("%d", &n);for(i=0;ia[j]){t=a[j];a[j]=a[i];a[i]=t;}}}}void PrintArr(int a[], int n){int i;for(i=0;i
边栏推荐
- PhpMetrics 使用
- Regular expression syntax and usage
- MySQL连接时出现2003错误
- 【MySQL】DQL相关操作
- ML's shap: Based on FIFA 2018 Statistics (2018 Russia World Cup) team match star classification prediction data set using RF random forest + calculating SHAP value single-sample force map/dependency c
- 打动中产精英群体,全新红旗H5用产品力跑赢需求
- Go1.18升级功能 - 模糊测试Fuzz 从零开始Go语言
- ThinkPHP high imitation blue play cloud network disk system source code / docking easy payment system program
- language code table
- Py之pdpbox:pdpbox的简介、安装、案例应用之详细攻略
猜你喜欢
随机推荐
Computer shortcut icon whitening solution
Rust编译报错:error: linker `cc` not found
【导航规划】导航规划背景知识总结
MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
WSL2设置默认启动用户(debian)
科技的成就(三十一)
PyTorch模型导出到ONNX文件示例(LeNet-5)
可视化工具Netron介绍
Mysql进阶优化篇01——四万字详解数据库性能分析工具(深入、全面、详细,收藏备用)
Reverse linked list - in-place inversion method
ZZULIOJ:1119: 数列有序
Detailed operator
DFS题单以及模板汇总
Abstract classes and interfaces (study notes)
QT开发简介、命名规范、signal&slot信号槽
网安学习-内网渗透3
【云驻共创】HCSD大咖直播–就业指南
Py之pdpbox:pdpbox的简介、安装、案例应用之详细攻略
EasyExcel综合课程实战
阿里云视频点播+项目实战