Ответы
Ответ дал:
0
Не парься, это легко)
program example;
var str: string;i, count: integer;begin write('Ваша строка: '); readln(str); i := length(str); if i > 0 then begin count := 1; while i > 0 do begin if str[i] = ' ' then count := count + 1; i := i - 1; end; end else count := 0; writeln('Количество слов: ', count); readln;end.
program example;
var str: string;i, count: integer;begin write('Ваша строка: '); readln(str); i := length(str); if i > 0 then begin count := 1; while i > 0 do begin if str[i] = ' ' then count := count + 1; i := i - 1; end; end else count := 0; writeln('Количество слов: ', count); readln;end.
Ответ дал:
0
program example;
var str: string;i, count: integer;begin write('Ваша строка: '); readln(str); i := length(str); if i > 0 then begin count := 1; while i > 0 do begin if str[i] = ' ' then count := count + 1; i := i - 1; end; end else count := 0; writeln('Количество слов: ', count); readln;end.
var str: string;i, count: integer;begin write('Ваша строка: '); readln(str); i := length(str); if i > 0 then begin count := 1; while i > 0 do begin if str[i] = ' ' then count := count + 1; i := i - 1; end; end else count := 0; writeln('Количество слов: ', count); readln;end.
Похожие вопросы
2 года назад
6 лет назад
6 лет назад
9 лет назад
9 лет назад