SHARE
TWEET

Untitled

a guest May 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="pl">
  3. <head>
  4. <meta charset="UTF-8">
  5. <script type="text/javascript">
  6. var pole;
  7. var r2;
  8. function polekola(){
  9. var promien2 = document.forms['promien'].promien.value;
  10. r2 = promien2*promien2;
  11. pole = 3.141592653589793238462643383279502884197169*r2;
  12. pole = Math.round(pole * 100) / 100;
  13. document.write("Pole wynosi: " + pole);
  14. return false;
  15. }
  16. function obwkola(){
  17. var promien3 = document.forms['promien'].promien.value;
  18. obw = 2*3.141592653589793238462643383279502884197169*promien3;
  19. obw = Math.round(obw * 100) / 100;
  20. document.write("Obwod wynosi: " + obw);
  21. return false;
  22. }
  23. </script>
  24. </head>
  25.     <body>
  26.     <form id="promien"><div>
  27.     Podaj promien: <input type="text" name="promien"><br>
  28.     <button onclick="polekola()">Oblicz pole</button>
  29.     <button onclick="obwkola()">Oblicz obwód</button>
  30.     </div></form>
  31.     <br><div id="wynik"></div>
  32.     </body>
  33.     </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