Есть ответ 👍

Написать программу на паскале песенку

211
448
Посмотреть ответы 1

Ответы на вопрос:

sinjay
4,4(23 оценок)

#include < iostream> #include < array> #include < algorithm> #include < functional> template < std: : size_t size> int count(std: : array< int, size> const& arr_, std: : function< bool(int)> const& f) {     return std: : count_if(arr_. arr_. f); } int main() {     std: : array< int, 5> arr = { -2, 0, 5, 0, -1 };     int positive = count(arr, [](int a){ return a > 0; });     int negative = count(arr, [](int a){ return a < 0; });     int zero = count(arr, [](int a){ return a == 0; });     std: : cout < < positive < < " " < < negative < < " " < < zero; }

Популярно: Информатика