VAR S:String; N,i:Integer; BEGIN WriteLn('Enter the string:'); ReadLn(S); i:=Length(S); N:=0; Repeat If S[i]='k' then Inc(N); Dec(i); Until S[i]=' '; WriteLn('Number of "k" letters in the last word of string is ',N); ReadLn; END.
Яндекс