Given the text. Print all the words that are different from the last one, after converting each of them according to the following rule: - swap the first and last letters of the word; Make via Pchar.
I did not find examples on PChar in nete. How it will look like, I only know that the procedures and functions are a bit different.
Through the lines:
Uses CRT; Var StrMas: Array[0..199] Of String; Str, MStr: String; MasInd, StrInd, StrLen, i: Word; C: Char; Begin Write('Введи строку: '); ReadLn(Str); StrLen:=Length(Str); StrInd:=1; MasInd:=0; While (StrInd<=StrLen) Do Begin While ((Str[StrInd]=' ') And (StrInd<=StrLen)) Do Inc(StrInd); MStr:=''; While ((Str[StrInd]<>' ') And (StrInd<=StrLen)) Do Begin MStr:=MStr+Str[StrInd]; Inc(StrInd); End; If (MStr<>'') Then Begin C:=MStr[1]; MStr[1]:=MStr[Length(MStr)]; MStr[Length(MStr)]:=C; StrMas[MasInd]:=MStr; End Else Break; Inc(MasInd); Inc(StrInd); End; For i:=0 To MasInd-2 Do If (StrMas[i]<>StrMas[MasInd-1]) Then WriteLn(StrMas[i]); WriteLn('Нажми на любую кнопку!!!'); Repeat Until (KeyPressed); End.