nyoj1306海拔
来源:互联网 发布:刷软件赚钱 编辑:程序博客网 时间:2024/04/28 10:50
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=1306
题目意思很清楚比如有一个序列n=7,1 2 3 4 5 6 7
按1 2 3 7 6 5 4的格式输出就行了
AC代码:
#include <stdio.h>#include <algorithm>using namespace std;int main() {int t, n, i, a[10086];scanf("%d", &t);while(t--) {scanf("%d", &n);for(i = 0; i < n; i++) scanf("%d", &a[i]);sort(a,a+n);for(i = 0; i < (n+1)/2-1; i++) printf("%d ", a[i]);printf("%d ", a[n-1]);for(n = n-2; n >= i; n--) printf("%d ", a[n]);printf("\n");}return 0;}
0 0
- nyoj1306海拔
- 海拔8848
- [NOI2010]海拔
- 上海海拔
- 【NOI2010】海拔
- NOI2010 海拔
- NOI2010 海拔
- [NOI2010]:海拔
- BZOJ 2007: [Noi2010]海拔
- bzoj 2007:[noi2010]海拔
- 【bzoj2007】【NOI2010】【海拔】
- 2007: [Noi2010]海拔
- 2007: [Noi2010]海拔
- 【NOI2010】bzoj2007 海拔
- BZOJ 2007: [Noi2010]海拔
- bzoj2007 [Noi2010]海拔
- BZOJ2007: [Noi2010]海拔
- 手机GPS获取海拔
- 十进制数(字符串)转换为十六进制数
- MAC 中搭建 Apache 下的 HTTPS 服务
- MySQL索引背后的数据结构及算法原理
- vs2010 引用动态库方法
- springmvc + freemarker 开发环境 缓存设置
- nyoj1306海拔
- vs2012使用方法
- Vue实例的一些简单方法
- sql查不存在的列
- 【PAT】1025. PAT Ranking
- Eclipse远程调试tomcat下部署的项目
- 非命令模式:用TortoiseSVN将主干代码合并到分支
- PagerAdapter,FragmentPagerAdapter,FragmentPagerStateAdapter的区别系列——缓存策略
- scanf函数简单问题讨论