Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Compare(s1, s2: string): Integer;
- begin
- if s1 <> s2 then
- if s1 > s2 then
- Result := 1
- else
- Result := -1;
- end;
- function GetRelation(s1, s2: string): string;
- var
- r: Integer;
- begin
- r := Compare(s1, s2);
- case r of
- -1: Result := ('"' + s1 + '" < "' + s2 + '"');
- 0: Result := ('"' + s1 + '" = "' + s2 + '"');
- 1: Result := ('"' + s1 + '" > "' + s2 + '"');
- end;
- end;
- begin
- ClearDebug;
- WriteLn(GetRelation('ABCD A', 'ABCD B'));
- WriteLn(GetRelation('ABCD B', 'ABCD B'));
- WriteLn(GetRelation('ABCD C', 'ABCD B'));
- end.
Advertisement
Add Comment
Please, Sign In to add comment