当前位置:网站首页>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 边栏推荐
猜你喜欢

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

Excel basic study notes

【Untitled】

PhpMetrics usage

网安学习-内网渗透3

【科研】文献下载神器方式汇总

【Untitled】

Navicat connection MySQL error: 1045 - Access denied for user 'root'@'localhost' (using password YES)

Abstract classes and interfaces (study notes)

MySQL compressed package installation, fool teaching
随机推荐
d违反常了吗
IDEA2021.2安装与配置(持续更新)
MySQL连接时出现2003错误
解决一个Mysql的utf8编码导致的问题
Successfully resolved ModuleNotFoundError: No module named 'Image'
TCP 连接 三次握手 四次挥手
openim支持十万超级大群
mysql跨库关联查询(dblink)
使用LVS和Keepalived搭建高可用负载均衡服务器集群
Day016 类和对象
[MySQL] Mysql transaction and authority management
Difference between cookie and session
WSL安装图形界面并通过xrdp/X-Launch访问
【翻译】作为混沌网的LFX门徒的经验
MYSQL JDBC Book Management System
科技的成就(三十一)
HF2022-EzPHP复现
IJCAI2022教程 | 口语语言理解:最新进展和新领域
反转链表-头插反转法
Regular expression syntax and usage