![]() |
|
#1
|
|||
|
|||
![]() Программа которая при вводе слова, считает количество согласных латинских букв и в ответе выдаёт это слово плюс этоже слово в перевернутом видео столько раз, сколько согласных букв в этом слове.
Всё готово, только немогу перевернуть. Подкскажите пожалуйста как. Код:
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Math; type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; Edit2: TEdit; Memo1: TMemo; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function GetConsonantCount (S: string): Integer; const Consonants: set of Char = ['b','c','d','f','g','h','k','l','m','n','p','r','s','t','v','z','x']; var I: Integer; begin Result := 0; S := LowerCase(S); for I := 1 to Length(S) do begin if S[i] in Consonants then Inc(Result) end end; function Count (const S: string): string; var I: Integer; ConsonantCount: Integer; begin ConsonantCount := GetConsonantCount(S); for I := 0 to ConsonantCount do Insert (S,Result,I*(Length(S)+1)); end; procedure TForm1.Button1Click(Sender: TObject); begin Edit2.Text := Count(Edit1.Text) end; end. |