当前位置:网站首页>-最高分-
-最高分-
2022-08-03 05:10:00 【-JMY-】
题目描述
五年级一班刚刚结束了一场考试,老师想知道最高分是多少,但是由于人数比较多,请你用编程来帮助老师。
输入
两行,第一行为整数n(1<=n<=100),表示参加考试的人数;
第二行是这n个学生的成绩,所有成绩都在0~100之间。
输出
输出最高成绩
样例输入
5 85 78 90 99 60
样例输出
99
参考代码:
#include<iostream>
using namespace std;
int main()
{
int maxn;
int n,a,b;
cin>>n;
for(int i=-1;i<=n;i++)
{
cin>>a;
if(a>maxn)
{
maxn=a;
}
}
cout<<maxn;
return 0;
}
边栏推荐
猜你喜欢
IO process thread -> thread -> day5
Harmony OS ets ArkUI 】 【 】 the development basic page layout and data connection
Power button 561. An array of split
Kaggle(四)Scikit-learn
Shell conditional statement judgment
【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed
网络流媒体下载的 10 种方法(以下载 Echo 音乐为例)
How to prepare for the test interface test data
web安全-PHP反序列化漏洞
shell脚本循环语句
随机推荐
ss-4.1-1个eurekaServer+1个providerPayment+1个consumerOrder
typescript41-class类的私有修饰符
2022暑假牛客多校联赛第一场
web安全-PHP反序列化漏洞
Secondary development of WinForm controls
反射注解基础
vim命令
Practical application of WebSocket
【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed
Modelarts第一次培训
User password verification
【Biotin Azide|cas:908007-17-0】Price_Manufacturer
快速上手 Mockito 单元测试框架
VR全景展打造专属元宇宙观展空间
presto安装部署教程
IO流及其操作
用户密码加密工具
Object类与常用API
ss-5.consul服务端+生产者+消费者
Presto installation and deployment tutorial