Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style>
- div.b {
- color: black;
- font-family: Bebas;
- font-size: 70px;
- -webkit-text-stroke-width: 3px;
- -webkit-text-stroke-color: white;
- word-spacing: 15px;
- }
- div.a {
- color: white;
- font-family: Bebas;
- font-size: 30px;
- -webkit-text-stroke-width: 2px;
- -webkit-text-stroke-color: black;
- }
- .button {
- background-color: white;
- border: none;
- color: black;
- padding: 15px 32px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 20px;
- font-family: Bebas;
- outline-style: ridge;
- outline-color: black;
- outline-width: 1px;
- }
- body
- {
- background-image: url("https://wallpapermemory.com/uploads/820/persona-5-background-full-hd-110880.jpg");
- }
- </style>
- <title>Javascript igor</title>
- </head>
- <body>
- <BR>
- <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
- <BR>
- <center>
- <div class="b">To jest strona Igora</div> <BR><BR>
- <button type="button" class="button" onclick="fibon()">Fibonnaci</button> <button type="button" class="button" onclick="piew()">Liczba pierwsza</button>
- <div class="a">
- <p id="JD"></p>
- <p id="demo"></p>
- <BR>
- <p id="XD"></p>
- <p id="GM"></p>
- </div>
- <script>
- function fibon()
- {
- var t1=0;
- var t2=1;
- var fibo;
- var elo=0;
- var els=1;
- var text;
- var tex = "";
- text = "Twoja liczba to:";
- document.getElementById("JD").innerHTML = text;
- var n = prompt("Która liczbe z ciagu fibonnaciego chcesz", "Przyklad: 1,5,2137");
- for (var i = 0; i <= n; ++i)
- {
- if(i == 1)
- {
- document.getElementById("demo").innerHTML = elo;
- continue;
- }
- if(i == 2)
- {
- document.getElementById("demo").innerHTML = els;
- continue;
- }
- fibo = t1 + t2;
- t1 = t2;
- t2 = fibo;
- }
- document.getElementById("JD").innerHTML = text ;
- document.getElementById("demo").innerHTML = fibo ;
- document.getElementById("XD").innerHTML = tex ;
- document.getElementById("GM").innerHTML = tex ;
- }
- function piew()
- { var k=0;
- var pie=0;
- var dzielne = [];
- var n = prompt("Która liczbe chcesz sprawdzic", "Przyklad: 1,5,2137");
- for(var i=1; i<=n; i++)
- {
- if(n%i==0)
- {
- pie++;
- dzielne[k]=i;
- k++;
- continue;
- }
- else
- {
- continue;
- }
- }
- if(pie<=2)
- {
- var iso;
- iso =" jest liczba pierwsza!";
- document.getElementById("JD").innerHTML = n ;
- document.getElementById("demo").innerHTML = iso ;
- }
- else
- {
- var text;
- var fiufiu = "Jest podzielna przez:";
- text =" nie jest liczba pierwsza!";
- document.getElementById("JD").innerHTML = n ;
- document.getElementById("demo").innerHTML = text ;
- document.getElementById("XD").innerHTML = fiufiu ;
- document.getElementById("GM").innerHTML = dzielne ;
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement