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

100 Problems & Solutions                                                Trang 45


                       fo = 'P3.out';

                      type mang=array[0..201,0..201] of byte;

                      var m,n,t:byte;
                       s:string;
                       a:mang;
                       f:text;
                       b,c:^mang;

                      procedure input;
                      var i,j:byte;
                      begin
                       assign(f,fi);
                       reset(f);
                       readln(f,m,n,t);
                       readln(f,s);
                       for i:=1 to m do
                       begin
                       for j:=1 to n do read(f,a[i,j]);
                       end;
                       close(f);
                       new(b);
                       new(c);
                      end;

                      procedure hien;
                      var i,j:byte;
                      begin
                       for i:=1 to m do
                       for j:=1 to n do
                       begin
                       gotoxy(j*2,i);
                       write(b^[i,j]);
                       end;

                      end;

                      procedure trans(ch:char);
                      var i,j,d:byte;
                      begin
                       fillchar(c^,sizeof(mang),0);
                       for i:=1 to m do
                       for j:=1 to n do
                       begin
                       d:=b^[i,j];
                       case a[i,j] of
                       1:inc(c^[i,j-1],d);
                       2:inc(c^[i,j+1],d);
                       3:inc(c^[i-1,j],d);



                      Tin học & Nhà trường                                       100 Đề Toán - Tin học
   40   41   42   43   44   45   46   47   48   49   50