• Прошу помогите язык СИ.

    В линейном списке целых чисел найти максимум и минимум

Ответы 1

  • #include <iostream>#include <iterator>#include <algorithm>#include <list>using namespace std;int main(){    setlocale(LC_ALL, "Rus");     cout << "Введите список и нажмите Ctrl+Z:"<<endl;     list<int> l;      copy(istream_iterator<int>(cin), istream_iterator<int>(),back_inserter(l));         list<int>::iterator it=max_element(l.begin(), l.end());      cout << "Максимум:"<<*it<<endl; it = min_element(l.begin(), l.end());      cout << "Минимум:" << *it << endl;          system("pause");        return 0;}
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years