#include <iostream>
#include <vector>
using namespace std;
void swap(int *a, int *b){
int temp = *a;
*a = *b;
*b = temp;
}
signed main() {
const int n = 10;
vector<int> a(n);
int mx = -INT_MAX, mn = INT_MAX, i = 0, j = 0;
for(int k = 0; k < n; k++){
cin >> a[k];
if(a[k] > mx){mx = a[k]; i = k;}
if(a[k] < mn){mn = a[k], j = k;}
swap(a[i],a[j]);
for(auto &i:a)
cout << i << " ";
#include <iostream>
#include <vector>
using namespace std;
void swap(int *a, int *b){
int temp = *a;
*a = *b;
*b = temp;
}
signed main() {
const int n = 10;
vector<int> a(n);
int mx = -INT_MAX, mn = INT_MAX, i = 0, j = 0;
for(int k = 0; k < n; k++){
cin >> a[k];
if(a[k] > mx){mx = a[k]; i = k;}
if(a[k] < mn){mn = a[k], j = k;}
}
swap(a[i],a[j]);
for(auto &i:a)
cout << i << " ";
}