#include #include using namespace std; double Mean(vector v) { double sum = 0; for (int i = 0; i < v.size(); ++i) { sum += v[i]; } if (v.size()) { return sum / v.size(); } return 0; } vector ReadGrades() { vector v(0); double temp = 0; int h; while (cin >> temp) { h = floor(temp); if (h >= 1 & h <= 5) { v.push_back(h); } else { cout << "Drink a coffe and insert a number from 1 to 5" << endl; } } return v; } vector ReadPoints(int a, int b) { cout << "Insert numbers from " << a << " to " << b << std::endl; vector v(0); double temp = 0; int h; while (cin >> temp) { h = floor(temp); if (h >= a & h <= b) { v.push_back(h); } else { cout << "Drink a coffe and insert a number from " << a << " to " << b << std::endl; } } return v; } int MaxPoint(vector v) { int maxValue = v[0]; for (int i = 1; i < v.size(); ++i) { if (v[i] > maxValue) { maxValue = v[i]; } } return maxValue; } int main() { vector v = ReadPoints(1,100); for (int i = 0; i < v.size(); ++i) { std::cout << v[i] << std::endl; } cout << "The max is: " << MaxPoint(v) << endl; return 0; }