hdoj1029
来源:互联网 发布:齐鲁大学生软件大赛 编辑:程序博客网 时间:2024/05/20 02:26
链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1029
//水题
//由于为奇数个,故排序后中间那个一定是所求
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
int *k;
int i;
while (cin >> n) {
k = (int *)malloc(sizeof(int)*n);
for (i = 0; i < n; i++) {
cin >> k[i];
}
sort(k, k+n);
cout << k[n/2] << endl;
}
return 0;
}
- hdoj1029
- hdoj1029
- hdoj1029简单题
- hdoj1029(基础DP)
- HDOJ1029 Ignatius and his princess IV
- HDOJ1029 Ignatius and the Princess IV
- hdoj1029 Ignatius and the Princess IV(对题目的观察?)
- 【C++ Primer】静态链接库(lib)和动态链接库(dll)的区别和使用
- 用 GDB 调试程序<转>
- hdoj 1021
- Shell 编程--本文结合大量实例阐述如何编写一个shell脚本
- 命令模式(Command)
- hdoj1029
- java类什么时候被加载
- 数据结构与算法分析-第一章Java类(04)
- hdoj1037
- 关于ListView中的Adapter说明以及列表增加最后一项(更多选项)的实现
- 一个SQL
- hdoj 1040
- 线性代数学习过程中使用的一些工具及技巧
- 杭电ACM 1715 大菲波数