Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project3;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils;
- var
- str : String;
- word : String;
- i, x : integer;
- maxres : integer;
- res : integer;
- isCorrect : boolean;
- hitler : integer;
- begin
- str := 'fjfjfjfjjfjfjfjf qeqeeqeq rtrttrtr ';
- str := str + ' ';
- x := 1;
- while (x <= length(str)) do
- begin
- maxres := 0;
- res := 0;
- isCorrect := false;
- word := '';
- hitler := 0;
- while (str[x] <> ' ') do
- begin
- word := word + str[x];
- inc(res);
- inc(x)
- end;
- writeln('', word);
- for i := 1 to (length(word) div 2 + 1) do
- begin
- if (word[i] = word[word.Length - i + 1]) then
- inc(hitler);
- end;
- if hitler = (length(word) div 2 + 1) then
- begin
- if maxres < res then
- maxres := res;
- writeln(word, ' - симметричное слово!');
- end;
- inc(x);
- end;
- writeln('maxres', maxres);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement