当前位置:网站首页>Sequence sorting of basic exercises of test questions
Sequence sorting of basic exercises of test questions
2022-07-04 01:36:00 【White phoenix leans on the sword and returns】
Resource constraints
The time limit :1.0s Memory limit :512.0MB
Problem description
Given a length of n Sequence of numbers , Arrange the sequence in descending order .1<=n<=200
Input format
The first line is an integer n.
The second line contains n It's an integer , Is the number to be sorted , The absolute value of each integer is less than 10000.
Output format
Output one line , Output the sorted sequence in descending order .
The sample input
5
8 3 6 4 9
Sample output
3 4 6 8 9
The code is as follows :
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, i, a[201];
cin >> n;
for (i = 0; i < n; i++) {
cin >> a[i];
}
sort(a, a + n);
cout << a[0];
for (i = 1; i < n; i++)
cout << " " << a[i];
}边栏推荐
- 51 single chip microcomputer timer 2 is used as serial port
- Some other configurations on Huawei's spanning tree
- PMP 考试常见工具与技术点总结
- ES6 deletes an attribute in all array objects through map, deconstruction and extension operators
- Special copy UML notes
- Introduction to A-frame virtual reality development
- MPLS③
- Install the pit that the electron has stepped on
- C import Xls data method summary IV (upload file de duplication and database data De duplication)
- Idsia & supsi & usi | continuous control behavior learning and adaptive robot operation based on Reinforcement Learning
猜你喜欢

基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
![CesiumJS 2022^ 源码解读[8] - 资源封装与多线程](/img/d2/99932660298b4a4cddd7e5e69faca1.png)
CesiumJS 2022^ 源码解读[8] - 资源封装与多线程

Introduction to superresolution

Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?

Three layer switching ①

Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL

“疫”起坚守 保障数据中台服务“不打烊”

2020-12-02 SSM advanced integration Shang Silicon Valley

Force buckle day32

MySQL statement learning record
随机推荐
Function: write function fun to find s=1^k+2^k +3^k ++ The value of n^k, (the cumulative sum of the K power of 1 to the K power of n).
Pyrethroid pesticide intermediates - market status and future development trend
Install the pit that the electron has stepped on
What are the advantages and disadvantages of data center agents?
ES6 deletes an attribute in all array objects through map, deconstruction and extension operators
MPLS experiment
Lightweight Pyramid Networks for Image Deraining
Ceramic metal crowns - current market situation and future development trend
Is Shengang securities company as safe as other securities companies
Audio resource settings for U3D resource management
技术实践|线上故障分析及解决方法(上)
AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
Conditional test, if, case conditional test statements of shell script
Introduction to unity shader essentials reading notes Chapter III unity shader Foundation
Difference between value and placeholder
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
MySQL utilise la vue pour signaler les erreurs, Explicit / show ne peut pas être publié; Verrouillage des fichiers privés pour la table sous - jacente
Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
Customize redistemplate tool class
查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题