Танк - машина специфическая. поэтому при отборе в танкисты было принято решение не брать призывников с самым высоким и самым низким ростом. вам дан рост каждого призывника. посчитайте количество призывников, взятых в танкисты. формат ввода: n – количество призывников (n < = 17) a1 – рост первого призывника a2 – рост второго призывника an – рост n-ого призывника пример ввода: 5 120 150 190 120 170 формат вывода: kol - количество взятых в танкисты пример вывода: 2
188
440
Ответы на вопрос:
/* 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; }
// 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.
Популярно: Информатика
-
Александра6665626.01.2022 22:06
-
Messi144427.03.2023 18:19
-
Afon726.02.2021 07:46
-
Эноа10.12.2021 10:35
-
crazy66005.11.2020 02:32
-
Настя1803112.04.2020 07:00
-
silverfinn20.09.2020 16:13
-
АлексаФокс06.06.2020 11:39
-
камран1231.07.2021 11:20
-
kkarinanexK28.12.2020 20:23