当前位置:网站首页>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
边栏推荐
- “蔚来杯“2022牛客暑期多校训练营4 N.Particle Arts 规律 方差
- “由于找不到MSVCP140.dll,无法继续执行代码,重新安装程序可能会解决此问题等”解决方案
- cmd (command line) to operate or connect to the mysql database, and to create databases and tables
- # Dasctf 7月赋能赛 WP
- $\text{ARC 145}$
- Successfully solved ImportError: always import the name '_validate_lengths'
- 【无标题】
- 力扣题(3)—— 无重复字符的最长子串
- Navicat cannot connect to mysql super detailed processing method
- 使用LVS和Keepalived搭建高可用负载均衡服务器集群
猜你喜欢
mysql跨库关联查询(dblink)
Mysql进阶优化篇01——四万字详解数据库性能分析工具(深入、全面、详细,收藏备用)
【MySQL】Mysql事务以及权限管理
cnpm installation steps
MySql统计函数COUNT详解
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
连号区间数
反转链表-就地逆置法
Go语学习笔记 - gorm使用 - gorm处理错误 Web框架Gin(十)
打动中产精英群体,全新红旗H5用产品力跑赢需求
随机推荐
The problem of sticky packets in tcp protocol transmission
2022.7.28
科技的成就(三十一)
OpenCV笔记(二十):滤波函数——filter2D
$\text{ARC 145}$
【无标题】
设备树的引入与体验
ZZULIOJ:1120: 最值交换
vulnhub靶机AI-Web-1.0渗透笔记
Day016 Classes and Objects
When Navicat connects to MySQL, it pops up: 1045: Access denied for user 'root'@'localhost'
proxy反向代理
【Untitled】
【2022-05-31】JS逆向之易企秀
【MySQL】DQL相关操作
PyTorch model export to ONNX file example (LeNet-5)
Excel basic study notes
Successfully resolved ModuleNotFoundError: No module named 'Image'
2021GDCPC Guangdong University Student Programming Competition B.Byfibonacci
MYSQL JDBC Book Management System