Var currentPos,wordsAmount:byte; groupWords:string; procedure isCorrect(startPos:byte); begin while currentPos+1<=length(groupWords) do if groupWords[currentPos+1]<>' ' then inc(currentPos) else break; if groupWords[startPos]=groupWords[currentPos] then inc(wordsAmount); end; begin readln(groupWords); wordsAmount:=0; currentPos:=1; while currentPos<=length(groupWords) do begin if (groupWords[currentPos]<>' ') then isCorrect(currentPos); inc(currentPos); end; writeln(wordsAmount); readln; end.
Мен жаишана жазасалаин проста алгым кептур ренжеме(ныз)