As Easy As A+B

Problem Description
These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.

Give you some integers, your task is to sort these number ascending (升序).

You should know how easy the problem is now!

Good luck!
 
Input
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.
 
Output
For each case, print the sorting result, and one line one case.
 
Sample Input
2
3 2 1 3
9 1 4 7 2 5 8 3 6 9
 
Sample Output
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】的更多相关文章

  1. 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 ...

  2. HDU 1040 As Easy As A+B (排序。。。水题)

    题意:给定n个数,让你从小到大排序. 析:不说什么了. 代码如下: #include <cstdio> #include <iostream> #include <cst ...

  3. hdu 1040 As Easy As A+B(排序)

    题意:裸排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namesp ...

  4. 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 ...

  5. HDU 1040 As Easy As A+B [补]

    今天去老校区找她,不想带电脑了,所以没时间A题了 /*******************************************************************/ As Ea ...

  6. hdu 5695 百度熊教体育 拓扑排序 好题

    Gym Class Time Limit: 6000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total S ...

  7. HDU 5572 An Easy Physics Problem (计算几何+对称点模板)

    HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...

  8. HDU 1285 确定比赛名次(拓扑排序模板)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1285 题目大意:有N个比赛队(1<=N<=500),编号依次为1,2,3,....,N进行 ...

  9. hdu 5288||2015多校联合第一场1001题

    pid=5288">http://acm.hdu.edu.cn/showproblem.php?pid=5288 Problem Description OO has got a ar ...

随机推荐

  1. 每天自己主动备份mysql脚本

    定时运行脚本: 1.运行 crontab -e 00 00 * * * /bin/bash yourpath/mysqlbak.sh 2.打开自己主动运行文件 vi /etc/crontab 在etc ...

  2. C#趣味程序---三色球问题

    问题:若一个口袋中放有12个球,3红3白和6黑,问从袋中随意取8个球,有多少种不同的颜色搭配? using System; namespace ConsoleApplication1 { class ...

  3. 在iOS中求数组元素中最大数与最小数

    之前求数组中某个数中的最大值与最小值.还真一个个比較,后来看到这种方法后,我就醉了 NSArray *testArray = [NSArray arrayWithObjects:@"-2.0 ...

  4. 2015.05.12,外语,读书笔记-《Word Power Made Easy》 15 “如何谈论不同人的特点” SESSION 45

    TEASER PREVIEW 以-ous结尾的,描绘某人特点的词语包括: fawning(['fɔ:niŋ] adj.奉承的),servilely(['sә:vail] adj. 卑屈的, 奴隶的) ...

  5. js中的三种函数写法

    js中的三种函数写法 <script type="text/javascript"> //普通的声明方式 function myFun(m,n){ alert(m+n) ...

  6. 机器学习 LR中的参数迭代公式推导——极大似然和梯度下降

    Logistic本质上是一个基于条件概率的判别模型(DiscriminativeModel). 函数图像为: 通过sigma函数计算出最终结果,以0.5为分界线,最终结果大于0.5则属于正类(类别值为 ...

  7. [MySQL] 按年度、季度、月度、周、日统计查询

    该死的mysql没有提供unix时间戳的专门处理函数,所以,如果遇到时间分组,而你用的又是整型unix时间戳,则只有转化为mysql的其他日期类型!   FROM_UNIXTIM()将unix时间戳转 ...

  8. 关于QObject类的一些理解

    QRunnable并没有继承自QObject,所以它和其他QObject组件的通信不能使用传统的信号和槽,要是用信号和槽我们必须将其继承自QObject自动的添加 QThread的退出最好用exit( ...

  9. TP5异常处理

    TP5异常处理 标签(空格分隔): php, thinkphp5 自定义异常处理 namespace app\common\exception; use think\Exception; class ...

  10. 今天,你Try-Catch了吗?

    引言: 高级语言中的异常处理很好用,对于有可能出错的代码我们用Try-Catch包起来,就能保证系统健壮的运行了,但是你的Try-Catch用对了吗? 今天code review的时候,老板给我提了个 ...