HDU 1040 As Easy As A+B (排序。。。水题)
题意:给定n个数,让你从小到大排序。
析:不说什么了。
代码如下:
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath> using namespace std;
const int maxn = 1000 + 5;
int a[maxn]; int main(){
int T, n; cin >> T;
while(T--){
scanf("%d", &n);
for(int i = 0; i < n; ++i) scanf("%d", &a[i]);
sort(a, a+n); printf("%d", a[0]);
for(int i = 1; i < n; ++i)
printf(" %d", a[i]);
printf("\n");
} return 0;
}
HDU 1040 As Easy As A+B (排序。。。水题)的更多相关文章
- HDU 1040 As Easy As A+B(排序)
As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a probl ...
- HDU 1040.As Easy As A+B【排序】【如题(水!水!水!)】【8月24】
As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a probl ...
- HDU排序水题
1040水题; These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fa ...
- HDU 5832 A water problem (带坑水题)
A water problem 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
- PAT甲题题解-1012. The Best Rank (25)-排序水题
排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询 ...
- PAT甲题题解-1062. Talent and Virtue (25)-排序水题
水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include < ...
- HDU 5889 Barricade(最短路+最小割水题)
Barricade Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total ...
- hdu 1040 As Easy As A+B(排序)
题意:裸排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namesp ...
- hdu 1040 As Easy As A+B
As Easy As A+B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T ...
随机推荐
- Unified shader model
https://en.wikipedia.org/wiki/Unified_shader_model In the field of 3D computer graphics, the Unified ...
- Becoming inspired - ASC - 2017 MARCH 24
Becoming inspired - The 11 questions to ask yourself when you feel uninspired @ Advanced Studio Clas ...
- unity Object-c交互
一.unity 调用 Object-c C/C++可以直接与Object-c交互,只要把文件后缀.m直接改成.mm,成为C/C++与Object-c混编文件.C#又可以调用C/C++方法,所以C#就是 ...
- 一个完整的Oracle建表的例子
建表一般来说是个挺简单的事情,但是Oracle的建表语句有很多可选的参数,有些我们可能平时不太用,用的时候又不知道怎么用,这里就写一个较完整的建表的例子: [sql] CREATE TABLE ban ...
- springmvc获取资源文件的两种方式(超简单)
1 比如我们在sc目录下新建一个db.properties文件内容如下 DriverClass=com.mysql.jdbc.Driverurl=jdbc:mysql://localhost:3306 ...
- SQL 2008登录的域账户与数据库服务器不再同一个域的 处理方法
try this: Use RUNAS to set your Windows Auth domain for database connections runas /user:domain\user ...
- 基元线程同步构造之 Mutes(互斥体)
互斥体实现了“互相排斥”(mutual exclusion)同步的简单形式(所以名为互斥体(mutex)). 互斥体禁止多个线程同时进入受保护的代码“临界区”(critical section). 因 ...
- Hadoop 初始化系统
hadoop namenode -format 或者 hdfs namenode -format 2.执行hadoop sbin 目录下的 start-dfs.sh start-yarn.sh3.查看 ...
- 大型运输行业实战_day04_2_高级查询
1.高级查询最总效果 2.高级查询步骤 2.1页面输入框显示 开始车站:<input id="startStation" type="text" valu ...
- 第七章 二叉搜索树 (d2)AVL树:插入