水题 第三站 Who's in the Middle
来源:互联网 发布:mac project 编辑:程序博客网 时间:2024/05/21 17:09
其实这个题没什么好犹豫的,直接排序然后输出中间值,但是提交却WA
后来看了网上的代码是要while循环= =
#include <iostream>#include <stdio.h>#include <math.h>#include <algorithm>#include <string.h>using namespace std;int a[10010];int main (){ int n; while(~scanf("%d",&n)) { for(int i=0; i<n; i++) { scanf("%d",&a[i]); } sort(a,a+n); printf("%d\n",a[n/2]); } return 0;}
所以如果没有写明输出要求,还是加上while循环吧!
阅读全文
0 0
- 水题 第三站 Who's in the Middle
- [2388]Who's in the Middle(水题)
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- Who's in the Middle
- pip 安装指定版本
- Android逆向之旅---Android中如何修改锁屏密码和恶意锁机样本原理分析
- 使用bootstrap制作响应式导航栏
- caffe 学习之梯度裁剪时裁剪多大比较合适
- 蓝牙4.1模块实现组网 (
- 水题 第三站 Who's in the Middle
- HUD 1041 Computer Transformation
- Jmeter学习问题总结
- SPOJ SUBXOR
- 电脑使用基础技巧
- set(3)
- x264多线程编码
- 数据链路层LLDP协议
- 利用@Order控制配置类/AOP/方法/字段的加载顺序