HDU 1040.As Easy As A+B【排序】【如题(水!水!水!)】【8月24】
As Easy As A+B
Give you some integers, your task is to sort these number ascending (升序).
You should know how easy the problem is now!
Good luck!
the same line.
It is guarantied that all integers are in the range of 32-int.
2
3 2 1 3
9 1 4 7 2 5 8 3 6 9
1 2 3
1 2 3 4 5 6 7 8 9
水题不解释:
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int t,n;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
int f[1010];
for(int i=0;i<n;i++)
scanf("%d",&f[i]);
sort(f,f+n);
for(int i=0;i<n;i++){
if(i!=0) printf(" ");
printf("%d",f[i]);
}
printf("\n");
}
return 0;
}
HDU 1040.As Easy As A+B【排序】【如题(水!水!水!)】【8月24】的更多相关文章
- 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 (排序。。。水题)
题意:给定n个数,让你从小到大排序. 析:不说什么了. 代码如下: #include <cstdio> #include <iostream> #include <cst ...
- 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 ...
- HDU 1040 As Easy As A+B [补]
今天去老校区找她,不想带电脑了,所以没时间A题了 /*******************************************************************/ As Ea ...
- hdu 5695 百度熊教体育 拓扑排序 好题
Gym Class Time Limit: 6000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S ...
- HDU 5572 An Easy Physics Problem (计算几何+对称点模板)
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...
- HDU 1285 确定比赛名次(拓扑排序模板)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1285 题目大意:有N个比赛队(1<=N<=500),编号依次为1,2,3,....,N进行 ...
- hdu 5288||2015多校联合第一场1001题
pid=5288">http://acm.hdu.edu.cn/showproblem.php?pid=5288 Problem Description OO has got a ar ...
随机推荐
- 每天自己主动备份mysql脚本
定时运行脚本: 1.运行 crontab -e 00 00 * * * /bin/bash yourpath/mysqlbak.sh 2.打开自己主动运行文件 vi /etc/crontab 在etc ...
- C#趣味程序---三色球问题
问题:若一个口袋中放有12个球,3红3白和6黑,问从袋中随意取8个球,有多少种不同的颜色搭配? using System; namespace ConsoleApplication1 { class ...
- 在iOS中求数组元素中最大数与最小数
之前求数组中某个数中的最大值与最小值.还真一个个比較,后来看到这种方法后,我就醉了 NSArray *testArray = [NSArray arrayWithObjects:@"-2.0 ...
- 2015.05.12,外语,读书笔记-《Word Power Made Easy》 15 “如何谈论不同人的特点” SESSION 45
TEASER PREVIEW 以-ous结尾的,描绘某人特点的词语包括: fawning(['fɔ:niŋ] adj.奉承的),servilely(['sә:vail] adj. 卑屈的, 奴隶的) ...
- js中的三种函数写法
js中的三种函数写法 <script type="text/javascript"> //普通的声明方式 function myFun(m,n){ alert(m+n) ...
- 机器学习 LR中的参数迭代公式推导——极大似然和梯度下降
Logistic本质上是一个基于条件概率的判别模型(DiscriminativeModel). 函数图像为: 通过sigma函数计算出最终结果,以0.5为分界线,最终结果大于0.5则属于正类(类别值为 ...
- [MySQL] 按年度、季度、月度、周、日统计查询
该死的mysql没有提供unix时间戳的专门处理函数,所以,如果遇到时间分组,而你用的又是整型unix时间戳,则只有转化为mysql的其他日期类型! FROM_UNIXTIM()将unix时间戳转 ...
- 关于QObject类的一些理解
QRunnable并没有继承自QObject,所以它和其他QObject组件的通信不能使用传统的信号和槽,要是用信号和槽我们必须将其继承自QObject自动的添加 QThread的退出最好用exit( ...
- TP5异常处理
TP5异常处理 标签(空格分隔): php, thinkphp5 自定义异常处理 namespace app\common\exception; use think\Exception; class ...
- 今天,你Try-Catch了吗?
引言: 高级语言中的异常处理很好用,对于有可能出错的代码我们用Try-Catch包起来,就能保证系统健壮的运行了,但是你的Try-Catch用对了吗? 今天code review的时候,老板给我提了个 ...