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

100 Problems & Solutions                                                Trang 52


                      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
                      sgd := 0;
                      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 ,j : integer;x ,y : real ) : boolean;
                      Var
                      ii: integer;
                      Begin
                      Thoaman := false;
                      For ii := 1 to i - 1 do
                      If (ii <> j) and bang( giatri( ii ,x ,y ) ,0 ) then
                      exit;
                      Thoaman := true;
                      End;
                      (*--------------------------------------------------------------------------*)
                      Function Catrieng( i : integer ) : integer;



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