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 ...
随机推荐
- jsfl 第一天
ctrl+f10,打开操作记录 通过打开到目标fla的舞台,然后运行写好的jsfl,默认就以目标fla为调试对象. 通过name可以获取层名字,帧标签,元件实例名等,name属性要根据对象的应用而产生 ...
- Nexus使用
Nexus使用: Nexus的默认登录账户:admin,密码:admin123. 以下为步骤说明: 1.右上角->login 2.左菜单->security->user->ad ...
- 前端开发-4-HTML-table&form&表单控制 标签
1.table标签 <!DOCTYPE html> <html lang="cn"> <head> <meta charset=" ...
- Java LinkList遍历方式
1.LinkedList的遍历方式 a.一般的for循环(随机访问) int size = list.size(); for (int i=0; i<size; i++) { list.get( ...
- tnsping 命令解析
C:\Users\nowhill>tnsping jljcz Oracle Net 工具(命令)tnsping,是一个OSI会话层的工具,它用来: 1)验证名字解析(name resolutio ...
- Delphi操作Excel(Use Oel)
Use ComObj: procedure TorderMore1.BitBtn2Click(Sender: TObject);var xlsFile:WideString; var ExcelA ...
- struts2的异常配置
1:当我们出现异常我们浏览器会直接暴露我们的技术结构,会给我们的项目带来一些安全隐患.2:当这种错误出现,给用户感觉是非常不友好.3:怎么解决 1:如果处理找不到action方法的错误呢? 在Stru ...
- hibernate 解决并发问题
hibernate 解决并发问题的策略有 1)设置hibernate事务隔离级别 2)hibernate中乐观锁的实现 ps:版本号是由hibernate自己维护的,我们自己只需要做以上二步即可实现乐 ...
- git 使用 添加分支
http://jingyan.baidu.com/album/19192ad83ea879e53e5707ce.html?picindex=1 修改配置 git config --global use ...
- ldd3 源码相关问题参见
参考地址: http://www.verydemo.com/demo_c92_i235635.html http://blog.csdn.net/silvervi/article/details/64 ...