#include < iostream> int main() { int n; bool flag = true; std: : cin > > n; while(n ! = 0) \\! ожидаем появления на входе нуля { while (n > = 10) { if(n / 10 % 10 > = n % 10) \\! сравниваем две последние цифры в числе flag = false; \\! если не совпадает с условием, flag = false, т.е. выведется 0 n = n / 10; } std: : cout < < flag < < std: : endl; flag = true; std: : cin > > n; } }
Мамедов
26.03.2023
Var a: array [1..1000] of integer; n, i, max, min, amount: integer; begin read(n); for i : = 1 to n do read(a[i]); max : = a[1]; min : = a[1]; amount : = 0; for i : = 1 to n do begin if a[i] > max then max : = a[i]; if a[i] < min then min : = a[i]; if (i mod 2 = 0) and (a[i] < 0) then amount : = amount + 1; end; writeln('sum of min and max equals ',max + min); writeln('amount of numbers below zero and on even places: ', amount); for i : = 1 to n do if i mod 2 = 0 then write(a[i], ' '); end.
Ответить на вопрос
Поделитесь своими знаниями, ответьте на вопрос:
Сколько мбайт информации содержит сообщение объемом 2 в 28 степени бит?