Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- zad.1
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <script type="text/javascript">
- let a = parseInt(prompt("Podaj liczbe"));
- function wartosc_bezwzgledna(a)
- {
- if(a>=0)
- document.write(a);
- else
- document.write(a*-1);
- }
- wartosc_bezwzgledna(a);
- </script>
- </head>
- <body>
- </body>
- </html>
- zad.2
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <script type="text/javascript">
- let a = parseInt(prompt("Podaj liczbe"));
- function czy_parzysta(a)
- {
- if(a%2==0)
- document.write(true);
- else
- document.write(false);
- }
- czy_parzysta(a);
- </script>
- </head>
- <body>
- </body>
- </html>
- zad.3
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <script type="text/javascript">
- let a = prompt("Podaj znak");
- let b = parseInt(prompt("Podaj dlugosc"));
- function szlaczek(a,b)
- {
- for(let i=1; i<=b; i++)
- {
- document.write(a);
- }
- }
- szlaczek(a,b);
- </script>
- </head>
- <body>
- </body>
- </html>
- zad.5
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="utf-8" />
- <script type="text/javascript">
- let a = parseInt(prompt("Podaj bok trojkata"));
- let b = parseInt(prompt("Podaj bok trojkata"));
- let c = parseInt(prompt("Podaj bok trojkata"));
- function obwod_trojkata(a,b,c)
- {
- document.write(a+b+c);
- }
- obwod_trojkata(a,b,c);
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement