题解
2025-07-28 12:34:34
发布于:浙江
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,t;//n为数量,t为输入的数
int maxn = -1001;//最大值初始化为最小
cin >> n;//输入数量
while(n--){//循环n次
cin >> t;//输入t
maxn = max(maxn,t);在t和maxn中取最大更新最大值
}
cout << maxn;//输出最大值
//不写return 0;好习惯
}
这里空空如也
有帮助,赞一个