Thứ Tư, 27 tháng 4, 2022

SO PASCAL

var a,b: string;

procedure giai;
var i: longint;
begin
    if length(a)<length(b) then
           write(-1);
    if length(a)>length(b) then
           write(1);
    if length(a)=length(b) then
    begin
         if a<b then write(-1);
        if a=b then write(0);
        if a>b then write(1);
    end;
end;

begin
     assign(input,'so.inp');     reset(input);
     assign(output,'so.out');     rewrite(output);
     readln(a);
     readln(b);
     giai;
     close(input);     close(output);
end.

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.