当前位置:网站首页>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 边栏推荐
- 设备树的引入与体验
- Computer shortcut icon whitening solution
- 【Untitled】
- mysql锁机制
- 代码越写越乱?那是因为你没用责任链
- ML之shap:基于FIFA 2018 Statistics(2018年俄罗斯世界杯足球赛)球队比赛之星分类预测数据集利用RF随机森林+计算SHAP值单样本力图/依赖关系贡献图可视化实现可解释性之攻略
- Ningbo Zhongning Pawn will transfer 29.5% of the equity for 2.8338 million yuan, and the owner's equity in 2021 will be 9.6875 million yuan
- “蔚来杯“2022牛客暑期多校训练营4 N.Particle Arts 规律 方差
- Gxlcms audio novel system/novel listening system source code
- 微软商店出现【0x800706D9】解决方法
猜你喜欢

482-静态库、动态库的制作、使用及区别

2022/07/30 学习笔记 (day20) 面试题积累

#yyds干货盘点# 面试必刷TOP101:判断链表中是否有环

Apache Doris系列之:深入认识实时分析型数据库Apache Doris

ThinkPHP高仿蓝奏云网盘系统源码/对接易支付系统程序

MYSQL JDBC Book Management System

Difference between cookie and session

win10重建索引

ML之shap:基于FIFA 2018 Statistics(2018年俄罗斯世界杯足球赛)球队比赛之星分类预测数据集利用RF随机森林+计算SHAP值单样本力图/依赖关系贡献图可视化实现可解释性之攻略

Compressing Deep Graph Neural Networks via Adversarial Knowledge Distillation
随机推荐
2022.7.28
电脑快捷方式图标变白解决方案
Excel基础学习笔记
grub learning
Golang 切片删除指定元素的几种方法
Chapter 8 Intermediate Shell Tools II
2022中国物流产业大会暨企业家高峰论坛在杭州举办!
Py's pdpbox: a detailed introduction to pdpbox, installation, and case application
PyTorch model export to ONNX file example (LeNet-5)
[MySQL] DQL related operations
Gxlcms audio novel system/novel listening system source code
Reverse linked list - in-place inversion method
PhpMetrics usage
Achievements of Science and Technology (31)
Go1.18升级功能 - 泛型 从零开始Go语言
MySQL 8.0.29 set and modify the default password
2021GDCPC广东省大学生程序设计竞赛 B.Byfibonacci
When Navicat connects to MySQL, it pops up: 1045: Access denied for user 'root'@'localhost'
cmd (command line) to operate or connect to the mysql database, and to create databases and tables
grub 学习