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

100 Problems & Solutions                                                Trang 54


                      i : integer;
                      Begin
                      Assign( f ,fn ); Reset( f );
                      Readln( f ,n );
                      For i := 1 to n do
                      Readln( f ,a[i] ,b[i] ,c[i] ); { ax + by = c }
                      Close( f );
                      End;
                      (*--------------------------------------------------------------------------*)
                      Procedure Chuanbi;
                      Begin
                      smien := 1;
                      End;
                      (*--------------------------------------------------------------------------*)
                      Function Giaodiem( i ,j : integer;Var x ,y : real ) : boolean;
                      Var
                      d ,dx ,dy :real;
                      Begin
                      d := a[i] * b[j] - a[j] * b[i];
                      dx:= c[i] * b[j] - c[j] * b[i];
                      dy := a[i] * c[j] - a[j] * c[i];
                      If d <> 0 then
                      begin
                      x := dx / d;
                      y := dy / d;
                      end;
                      Giaodiem := d <> 0;
                      End;
                      (*--------------------------------------------------------------------------*)
                      Function Giatri( i : integer;x ,y : real ) : real;
                      Begin
                      Giatri := a[i] * x + b[i] * y - c[i];
                      End;
                      (*--------------------------------------------------------------------------*)
                      Function bang( a ,b : real ) : boolean;
                      Begin
                      bang := abs( a - b ) <= exp;
                      End;
                      (*--------------------------------------------------------------------------*)
                      Function Thoaman( i : integer;x ,y : real ) : boolean;
                      Var
                      ii : integer;
                      Begin
                      Thoaman := false;
                      For ii := 1 to i - 1 do
                      If bang( Giatri( ii ,x ,y ) ,0 ) then
                      exit;
                      Thoaman := true;
                      End;
                      (*--------------------------------------------------------------------------*)



                      Tin học & Nhà trường                                       100 Đề Toán - Tin học
   49   50   51   52   53   54   55   56   57   58   59