Есть ответ 👍

Танк - машина специфическая. поэтому при отборе в танкисты было принято решение не брать призывников с самым высоким и самым низким ростом. вам дан рост каждого призывника. посчитайте количество призывников, взятых в танкисты. формат ввода: n – количество призывников (n < = 17) a1 – рост первого призывника a2 – рост второго призывника an – рост n-ого призывника пример ввода: 5 120 150 190 120 170 формат вывода: kol - количество взятых в танкисты пример вывода: 2

188
440
Посмотреть ответы 2

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


/* c++ compiler gcc (ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 copyright (c) 2015 free software foundation, inc. */ #include < iostream> #include < vector> using namespace std; int main() {       int count = 0;       cout < < "введите количество призывников: ";       cin > > count;       if (count> 17) count=17;       vector< int> tanks(count);       for (unsigned i=0; i< tanks.size(); i++) cin > > tanks[i];       int min=300, max=0;       for (unsigned i=0; i< tanks.size(); i++)       {               if (min> tanks[i]) min=tanks[i];               if (max< tanks[i]) max=tanks[i];       }       int cnt=0;       for (unsigned i=0; i< tanks.size(); i++)       {               if ((tanks[i]! =min) and (tanks[i]! =max)) cnt++;       }       cout < < cnt < < endl; }
Finikotik
4,6(35 оценок)

// pascalabc.net 3.0, сборка 1156 от 30.01.2016 begin   var s: =readlnstring('вводите: ');   s: =s.replace('and','or');   s: =s.replace('and','or');   s: =s.replace('and','or');   writeln;   writeln(s) end. тестовое решение: вводите: and for the birds? mowgli let out a kite’s whistle. and now for the snake people. the answer was a perfect hiss. mowgli clapped his hands happily and jumped on bagheera’s back. or for the birds? mowgli let out a kite’s whistle. or now for the snake people. the answer was a perfect hiss. mowgli clapped his hors happily or jumped on bagheera’s back.

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