好简答
2024-11-09 21:49:07
发布于:江苏
1阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
int max_num =-100;
int min_num = 100;
for(int i=1;i<=n;i++)
{
int num;
cin>>num;
if( num > max_num)
{
max_num = num;
}
if( num < min_num)
{
min_num = num;
}
}
cout<<min_num<<" "<<max_num;
return 0;
}
这里空空如也
有帮助,赞一个