0
点赞
收藏
分享

微信扫一扫

不确定输入数据的个数如何处理

青乌 2022-07-12 阅读 156
#include <iostream>
#include<algorithm>
#include<vector>
int a[100000];
using namespace std;
int main()
{
int temp,pos=0;
while(cin >> temp)
{
a[pos++] = temp;
if(cin.peek()=='\n')
break;
}
cout << *max_element(a,a+pos)<< " " << *min_element(a,a+pos);
}


举报

相关推荐

0 条评论