Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Trójkąta</title>
  4. <meta charset="UTF-8">
  5. <!--link rel="stylesheet" href="style.css"-->
  6. <style>
  7. body{
  8. display:flex;
  9. align-items:center;
  10. justify-content:center;
  11. font-family:Arial;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div>
  17. <h1>Sample Text</h1>
  18. </div>
  19. <script>
  20.  
  21. let x = prompt("Wprowadź x", 0),
  22. y = prompt("Wprowadź y", 0);
  23. const h = document.querySelector("h1");
  24.  
  25. function comp(a, b){
  26. for(let i = a-1; i>0; i--){
  27. if(a%i==0 && b%i==0){
  28. return i;
  29. }
  30. }
  31. }
  32.  
  33. comp(x, y);
  34.  
  35. let nww = (x*y)/comp(x, y);
  36. h.innerHTML = nww;
  37.  
  38. </script>
  39. </body>
  40. </html>
  41.  
  42. Mr. Kaminsky
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement