Ответы 1

  • program add_bit; var str: string; count, i: integer; new_bit: char; begin write('Введите битовую строку: '); readln(str); count := 0; for i := 1 to length(str) do begin if str[i] = '1' then count := count + 1; end; if count mod 2 = 0 then new_bit := '0' else new_bit := '1'; str := str + new_bit; writeln('Получившаяся строка: ', str); end.
    • Автор:

      austin19
    • 2 года назад
    • 0
  • Добавить свой ответ

Войти через Google

или

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

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

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