Page 61 - C:\Users\Admin\Desktop\Sach mem upweb\
P. 61

100 Problems & Solutions                                                Trang 61


                      Procedure Daohinh;
                      Var  hinh1 : bang;
                              i,j : integer;
                      Begin
                        hinh1 := hinh;
                        For i := 1 to sh do
                          For j := 1 to sc do hinh[i,j] := hinh1[sh-i+1,j];
                      End;

                      Function Bethat : boolean;
                      Var  ii,jj    :integer;
                      Begin
                        Bethat := false;
                        For ii := 1 to sh do
                          For jj := 1 to sc do
                            If hinh[ii,jj] <> hinh1[ii,jj] then
                                 begin
                                        Bethat:= hinh[ii,jj] < hinh1[ii,jj];
                                        exit;
                                 end;
                      End;

                      Function Behon : boolean;
                      Begin
                        Behon := Bethat;
                      End;

                      Function Xethinhvuong : boolean;
                      Begin
                        Xethinhvuong :=    false;
                        Quaytrai;
                        If Behon then exit; Quaytrai;
                        If Behon then exit; Quaytrai;
                        If Behon then exit; Daohinh;
                        If Behon then exit; Quaytrai;
                        If Behon then exit; Quaytrai;
                        If Behon then exit; Quaytrai;
                        If Behon then exit; Xethinhvuong := true;
                      End;

                      Function Xetchunhat : boolean;
                      Begin
                        Xetchunhat := false;
                        Lathinh;
                        If Behon then exit; Daohinh;
                        If Behon then exit; Lathinh;
                        If Behon then exit; Xetchunhat := true;
                      End;






                      Tin học & Nhà trường                                       100 Đề Toán - Tin học
   56   57   58   59   60   61   62   63   64   65   66