Перевести код с паскаля на питон!
var s: string;
i, k: integer;
f: boolean;

begin
write('s = ');
readln(s);
k := 0;
f := false;
for i := 1 to length(s) - 1 do
begin
if not(f) then f := s[i] in [':', ';'];
if f and (s[i + 1] = '-') then continue;
if f and (s[i + 1] in ['(', ')', '[', ']']) then inc(k);
f := false
end;
writeln('Smiles: ', k);
readln
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.