Răspuns :
#include <iostream>
using namespace std;
main()
{int n, max=-32000, min=32000, i, v[100];
cin>>n;
for (i=1; i<=n; i++)
cin>>v[i];
if (min>v[i])
min=v[i];
if (max<v[i])
max=v[i];
cout<<min<<" "<<max; }
using namespace std;
main()
{int n, max=-32000, min=32000, i, v[100];
cin>>n;
for (i=1; i<=n; i++)
cin>>v[i];
if (min>v[i])
min=v[i];
if (max<v[i])
max=v[i];
cout<<min<<" "<<max; }
#include <iostream>
using namespace std;
int main() {
int n, max = -100, min = 100;
cin >> n;
for(int i = 0; i < n; i++) {
int val;
cin >> val;
if(val > max)
max = val;
if(val < min)
min = val;
}
cout << min << " "<< max;
return 0;
}
using namespace std;
int main() {
int n, max = -100, min = 100;
cin >> n;
for(int i = 0; i < n; i++) {
int val;
cin >> val;
if(val > max)
max = val;
if(val < min)
min = val;
}
cout << min << " "<< max;
return 0;
}