Задача 5 Урок 18
Primary tabs
Задача 5 Урок 181.Пользователь вводит произвольную строку, посчитайте количество чисел в ней - тех, что больше 125.
var n, s: string; i, j: integer; intChislo, Code : Integer; q:integer; begin writeln ('enter the line'); // readln(s); s:='123fdgF364sdf45g'; n:=''; q:=0; for i := 1 to length(s) do if (s[i] >= '0') and (s[i] <= '9') then begin n:= n+s[i]; if not ((s[i + 1] >= '0') and (s[i + 1] <= '9')) and (n <> '') then begin val(n,intChislo, Code); q:=intChislo; if q>125 then writeln (q,' ','>',' ','125'); n:=''; q:=0; end; end; readln(); end.
Вывод консоли:
enter the line 364 > 125
- Log in to post comments
- 332 reads