Problem D: 求最高同学位置
2016-03-18 21:21
375 查看
Problem D: 求最高同学位置
Time Limit: 1 Sec Memory Limit:128 MBSubmit: 487 Solved: 353
[Submit][Status][Web
Board]
Description
设一维数组存放了n(<100)名同学的身高,编写函数求身高最高同学的位置,如果结果有多个,需要输出所有人的位置。部分代码已给定如下,只需要提交缺失的代码。
#include <iostream>
using namespace std;
int main()
{
int getHeight(float height[],int n,float result[]);
float height[100],result[100];
int i,num,n;
cin>>n;
for(i=0; i<n; i++)
cin>>height[i];
num=getHeight( height,n,result);
for(i=0; i<num; i++)
cout<<i+1<<":"<<result[i]<<endl;
return 0;
}
Input
n和n名同学的身高Output
身高最高同学的位置,多个结果每行显示一个。Sample Input
10 1.7 1.69 1.82 1.59 1.93 1.77 1.93 1.78 1.93 1.72
Sample Output
1:5 2:7 3:9
HINT
[Submit][Status][WebBoard]
한국어 中文
فارسی
English ไทย
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2014
HUSTOJ TEAM
GPL2.0 2003-2014HUSTOJ Project TEAM
相关文章推荐
- python数据类型--序列
- 20. Valid Parentheses
- [置顶] Sublime优美设置(待续)
- 将URI对象转换为文件绝对路径的方法
- HDU-1176-免费馅饼
- Problem C: 统计不及格人数
- python数据类型
- 图数据库Neo4j介绍
- java实现oracle数据库基本操作
- JavaScript:Object.prototype.toString进行数据类型判定
- 205. Isomorphic Strings
- Apache Kafka编程入门指南:Producer
- 读《java夜未眠》
- 5. Java引用与C++区别
- Android好用的okhttp网络封装(get,post,上传,下载)
- 【C++】《C++标准程序库》小结七章-迭代器
- 宏和函数的比较(C/C++)
- 190. Reverse Bits
- Struts2 注解模式(范例)
- PowerShell Studio 2016