杭电acm--1040
来源:互联网 发布:网络媒介推广 编辑:程序博客网 时间:2024/05/17 04:24
Input contains multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains an integer N (1<=N<=1000 the number of integers to be sorted) and then N integers follow in the same line.
It is guarantied that all integers are in the range of 32-int.
It is guarantied that all integers are in the range of 32-int.
Output
For each case, print the sorting result, and one line one case.
#include<stdio.h>#include<stdlib.h>#include<iostream>#include<cmath>#include<iomanip>//#define P 3.141592653using namespace std;void main(){int n, T, t;int arr[1000];cin >> T;while (T--){cin >> n;for (int i = 0; i<n; i++)cin >> arr[i];for (int i = 0; i<n; i++){for (int j = i + 1; j<n; j++){if (arr[i]>arr[j]){t = arr[i];arr[i] = arr[j];arr[j] = t;}}}cout << arr[0];for (int i = 1; i<n; i++)cout << " " << arr[i];cout << endl;}system("pause");}
0 0
- 杭电acm--1040
- 杭电acm-1040
- 杭电ACM 1001,1040,1096
- 杭电ACM 1003
- 杭电 ACM 2016
- 杭电acm 1010
- 杭电 acm 1045
- 杭电ACM-1010
- 杭电ACM 1172
- 杭电ACM 1174
- 杭电ACM 1175
- 杭电ACM 分类
- 杭电ACM分类
- 杭电acm 1000
- 杭电acm 1001
- 杭电acm 1002
- 杭电acm分类
- 杭电acm分类
- Oracle-PlSQL程序设计
- Unity接口函数Vector3.Project()
- struts2拦截器问题
- 写代码,请不要中断
- 【LeetCode】Binary Tree Level Order Traversal 解题报告
- 杭电acm--1040
- 侧滑返回功能失效解决
- centos7 matlab install
- linux上应用程序的执行机制
- Rotate Array
- PYTHON数据可视化
- 如何在ROS下编写自己的节点来订阅话题(C++)
- ps
- UIView与CALayer的理解