SHARE
TWEET

Untitled

a guest Sep 16th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3.   <head>
  4.   <title></title>
  5.   </head>
  6.   <body>
  7.  
  8.  <script language="JavaScript">
  9.   function vypocti()
  10.   {
  11.   av = document.getElementById("a").value*1;
  12.   bv = document.getElementById("b").value*1;
  13.   cv = document.getElementById("c").value*1;
  14.  
  15.   D = (bv*bv)-(4*av*cv)
  16.  
  17.   /*if D < 1
  18.   {} */
  19.  
  20.   kor_1 = ((((bv)*(-1)) + Math.sqrt(D)) / (2*av));
  21.   kor_2 = ((((bv)*(-1)) - Math.sqrt(D)) / (2*av));
  22.  
  23.  
  24.   document.getElementById("koren_1").value = kor_1;
  25.   document.getElementById("koren_2").value = kor_2;
  26.   document.getElementById("Diskri").value = D;  
  27.   }
  28.   </script>  
  29.  
  30. Zadejte hodnoty: <br>
  31.  
  32. A: <input type="text" id="a"><br>  
  33. B: <input type="text" id="b"><br>
  34. C: <input type="text" id="c"><br>
  35. <input type="button" value="Vypočítej" onclick="vypocti()">
  36.  
  37. <hr>
  38.  
  39. Výsledek: <br>
  40. Diskriminant: <input type="text" id ="Diskri"><br>
  41. Kořen 1: <input type="text" id ="koren_1"><br>
  42. Kořen 2: <input type="text" id ="koren_2">
  43.  
  44.   </body>
  45. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top