التحدي الشبه مستحيل
#2
الخدعة هي أني أدخلت القانون هكذا
PHP كود :
procedure TForm3.Button1Click(Sender: TObject);
 var 
a,b,c,d,x1,x2 : real;
begin
    resultat
.Text := '';
 
   a := strtofloat(edit1.text);
 
   b := strtofloat(edit2.text);
 
   c := strtofloat(edit3.text);
 
   d := power(b,2) - 4*a*c;

 
   x1 := -b/(2*a);
 
   if d>=0 then
    begin
      x2 
:= sqrt(d)/(2*a);
 
    resultat.Lines.Add('d=' + floattostr(d));
 
   if d>0 then
    begin
    resultat
.Lines.Add('x1=' + floattostr(x1 - x2));
 
   resultat.Lines.Add('x2=' + floattostr(x1 + x2));
 
   end;
 
   if d=0 then
    begin
    resultat
.Lines.Add('x=' + floattostr(x1));
 
   end;
 
   end;
 
   if(d<0) then
    begin
    x2 
:= sqrt(-d)/(2*a);
 
   resultat.Lines.Add('d=' + floattostr(d));
 
   resultat.Lines.Add('x1=' + floattostr(x1) + '-' + floattostr(x2) + 'i');
 
   resultat.Lines.Add('x2=' + floattostr(x1) + '+' + floattostr(x2) + 'i')
 
   end; 
 فعرفته على شكل نص لا على شكل عدد مركب
chams derreche
الرد


الردود في هذا الموضوع
التحدي الشبه مستحيل - بواسطة chamsderreche - 06-04-2018, 08:24 PM
RE: التحدي الشبه مستحيل - بواسطة chamsderreche - 07-04-2018, 11:28 AM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم