commit b73a399210acdbae06ca6e1d9947a6fed9c32f35 Author: aguzik Date: Tue May 21 09:17:59 2024 +0200 matura 20.05 diff --git a/index.html b/index.html new file mode 100644 index 0000000..0b0a059 --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + + + Document + + + + + \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..0b8a956 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +def iloczyn(x: int ,y: int ) -> int: + if y == 1: + return x + else: + k = y // 2 + z = iloczyn(x,k) + if y % 2 == 0: + return z + z + else: + return x + z + z + +print(iloczyn(9,11)) +print(iloczyn(9,5)) +print(iloczyn(9,2)) +print(iloczyn(9,1)) \ No newline at end of file diff --git a/scirpt.js b/scirpt.js new file mode 100644 index 0000000..0c2535a --- /dev/null +++ b/scirpt.js @@ -0,0 +1,17 @@ +function iloczyn(x, y) { + if (y == 1) { + return x; + } else { + k = Math.floor(y / 2); + z = iloczyn(x, k); + if (y % 2 == 0) { + return z + z; + } else { + return x + z + z; + } + } +} + +console.log(iloczyn(9, 11)); +console.log(iloczyn(9, 5)); +console.log(iloczyn(9, 1)); diff --git a/sufix.js b/sufix.js new file mode 100644 index 0000000..9979353 --- /dev/null +++ b/sufix.js @@ -0,0 +1,12 @@ +function sufixy(slowo) { + dlugosc = slowo.length; + let wynik = Array(); + + for (let i = 0; i < dlugosc; i++) { + wynik.push(slowo); + slowo = slowo.slice(1); + } + return "Nieposortowane: " + wynik + ", Posortowane: " + wynik.sort(); +} + +console.log(sufixy("slowo"));