简简单单 的 题解
2025-12-24 20:32:04
发布于:浙江
1阅读
0回复
0点赞
本题考查:
1,本题考查的是各位学员函数的运用;
解题思路:
1,先定义变量/数组,输入之后用最小,最大变量+函数分别便利;
示例代码:
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int maxe=-100005,mine=100005;
while(n--){
int x;
cin>>x;
mine=min(mine,x);
maxe=max(maxe,x);
}
cout<<mine<<" "<<maxe;
return 0;
}
这里空空如也







有帮助,赞一个