1) #include <iostream>
#include <algorithm>
using namespace std;
int main() {
vector<float> arr;
float temp;
for(int i = 0; i<4; ++i) {
cout << "Num #" << i+1 << ": ";
cin >> temp;
arr.push_back(temp);
}
sort(arr.begin(), arr.end());
cout << endl << (arr[0] + arr[arr.size()-1]) / 2;
2) #include <iostream>
float temp, amount;
cout << "amount: ";
cin >> amount;
for(int i = 0; i<amount; ++i) {
1) #include <iostream>
#include <algorithm>
using namespace std;
int main() {
vector<float> arr;
float temp;
for(int i = 0; i<4; ++i) {
cout << "Num #" << i+1 << ": ";
cin >> temp;
arr.push_back(temp);
}
sort(arr.begin(), arr.end());
cout << endl << (arr[0] + arr[arr.size()-1]) / 2;
}
2) #include <iostream>
#include <algorithm>
using namespace std;
int main() {
vector<float> arr;
float temp, amount;
cout << "amount: ";
cin >> amount;
for(int i = 0; i<amount; ++i) {
cout << "Num #" << i+1 << ": ";
cin >> temp;
arr.push_back(temp);
}
sort(arr.begin(), arr.end());
cout << endl << (arr[0] + arr[arr.size()-1]) / 2;
}