输入两行,第一行为整数,n(1<= n < 100),表示参加这次考试的人数,第二行是这n个学生的成绩,相邻两个数之间用空格隔开,所有成绩均为0—100之间的整数。
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n,m,max;
max = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> m;
if (m > max)
{
max = m;
}
}
cout << max;
}
© 版权声明
THE END
暂无评论内容