Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <style>
  5. div.b {
  6. color: black;
  7. font-family: Bebas;
  8. font-size: 70px;
  9. -webkit-text-stroke-width: 3px;
  10. -webkit-text-stroke-color: white;
  11. word-spacing: 15px;
  12. }
  13. div.a {
  14. color: white;
  15. font-family: Bebas;
  16. font-size: 30px;
  17. -webkit-text-stroke-width: 2px;
  18. -webkit-text-stroke-color: black;
  19. }
  20. .button {
  21. background-color: white;
  22. border: none;
  23. color: black;
  24. padding: 15px 32px;
  25. text-align: center;
  26. text-decoration: none;
  27. display: inline-block;
  28. font-size: 20px;
  29. font-family: Bebas;
  30. outline-style: ridge;
  31. outline-color: black;
  32. outline-width: 1px;
  33.  
  34. }
  35. body
  36. {
  37. background-image: url("https://wallpapermemory.com/uploads/820/persona-5-background-full-hd-110880.jpg");
  38. }
  39. </style>
  40. <title>Javascript igor</title>
  41. </head>
  42. <body>
  43. <BR>
  44. <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
  45. <BR>
  46.  
  47.  
  48.  
  49. <center>
  50. <div class="b">To jest strona Igora</div> <BR><BR>
  51. <button type="button" class="button" onclick="fibon()">Fibonnaci</button> <button type="button" class="button" onclick="piew()">Liczba pierwsza</button>
  52. <div class="a">
  53.  
  54. <p id="JD"></p>
  55. <p id="demo"></p>
  56. <BR>
  57. <p id="XD"></p>
  58. <p id="GM"></p>
  59. </div>
  60. <script>
  61. function fibon()
  62. {
  63. var t1=0;
  64. var t2=1;
  65. var fibo;
  66. var elo=0;
  67. var els=1;
  68. var text;
  69. var tex = "";
  70. text = "Twoja liczba to:";
  71. document.getElementById("JD").innerHTML = text;
  72. var n = prompt("Która liczbe z ciagu fibonnaciego chcesz", "Przyklad: 1,5,2137");
  73. for (var i = 0; i <= n; ++i)
  74. {
  75. if(i == 1)
  76. {
  77. document.getElementById("demo").innerHTML = elo;
  78. continue;
  79. }
  80. if(i == 2)
  81. {
  82. document.getElementById("demo").innerHTML = els;
  83. continue;
  84. }
  85.  
  86. fibo = t1 + t2;
  87. t1 = t2;
  88. t2 = fibo;
  89. }
  90. document.getElementById("JD").innerHTML = text ;
  91. document.getElementById("demo").innerHTML = fibo ;
  92. document.getElementById("XD").innerHTML = tex ;
  93. document.getElementById("GM").innerHTML = tex ;
  94. }
  95. function piew()
  96. { var k=0;
  97. var pie=0;
  98. var dzielne = [];
  99. var n = prompt("Która liczbe chcesz sprawdzic", "Przyklad: 1,5,2137");
  100. for(var i=1; i<=n; i++)
  101. {
  102. if(n%i==0)
  103. {
  104. pie++;
  105. dzielne[k]=i;
  106. k++;
  107. continue;
  108. }
  109. else
  110. {
  111. continue;
  112. }
  113. }
  114. if(pie<=2)
  115. {
  116. var iso;
  117. iso =" jest liczba pierwsza!";
  118. document.getElementById("JD").innerHTML = n ;
  119. document.getElementById("demo").innerHTML = iso ;
  120. }
  121. else
  122. {
  123. var text;
  124. var fiufiu = "Jest podzielna przez:";
  125. text =" nie jest liczba pierwsza!";
  126. document.getElementById("JD").innerHTML = n ;
  127. document.getElementById("demo").innerHTML = text ;
  128. document.getElementById("XD").innerHTML = fiufiu ;
  129. document.getElementById("GM").innerHTML = dzielne ;
  130. }
  131. }
  132. </script>
  133. </body>
  134. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement