diff --git a/Zadania/Z94 - max i indeksy w tablicy jednowymiarowej/index.php b/Zadania/Z94 - max i indeksy w tablicy jednowymiarowej/index.php
new file mode 100644
index 0000000..8cec471
--- /dev/null
+++ b/Zadania/Z94 - max i indeksy w tablicy jednowymiarowej/index.php
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+ Z94 - max i indeksy w tablicy jednowymiarowej
+
+
+
+
+ Zadanie Z94
+ Autor: Jakub Grzegorczyk
+
+
+
+ Napisz program, który wczytuje liczby całkowite do jednowymiarowej tablicy, wyświetla tę tablicę, wyświetla maksymalną wartość zapisaną w tablicy oraz wskaźniki elementów zawierających tę maksymalną wartość. Użytkownik wprowadza liczby do komponentu textarea oddzielone przecinkami. Program powinien zweryfikować, czy podane wartości są liczbami całkowitymi, a w odpowiedzi podać liczbę elementów, maksymalną wartość oraz indeksy elementów o tej wartości.
+
+ Uwaga: Do wygenerowania liczb oddzielonych przecinkami możesz wykorzystać zadanie z85.
+
+
Wskazówki dla ucznia:
+
+ Użyj explode(), aby rozdzielić ciąg z textarea na tablicę liczb na podstawie przecinków.
+ Zweryfikuj, czy każda wartość jest liczbą całkowitą za pomocą is_numeric() i sprawdzenia, czy po konwersji na int nie traci wartości dziesiętnej.
+ Użyj max(), aby znaleźć maksymalną wartość, a następnie przeszukaj tablicę, aby znaleźć indeksy za pomocą pętli lub array_keys().
+ Liczbę elementów uzyskaj za pomocą count().
+ Zabezpiecz dane wejściowe za pomocą htmlspecialchars() przy pobieraniu, aby chronić przed XSS.
+
+
+
+
+
+';
+ if ($areValid) {
+
+ echo 'Wprowadzone wartości: ' . implode(', ', $values) . ' ';
+ echo "Tablica jednowymiarowa ($n elementów):";
+ echo '';
+ for ($i = 0; $i < $n; $i++) {
+ echo "tab[$i] = " . $values[$i] . ' ';
+ }
+ echo ' ';
+ echo "Liczba elementów: $n ";
+ echo "Maksymalna wartość: " . max($values) . ' ';
+ echo "Indeksy elementów z maksymalną wartością: " . implode(', ', $maxIndex) . '';
+ } else {
+ echo 'Dane wejściowe nie są poprawne! Sprawdź czy wszystkie są liczbami.';
+ }
+ echo '';
+}
+?>
+
+
diff --git a/Zadania/Z94 - max i indeksy w tablicy jednowymiarowej/style.css b/Zadania/Z94 - max i indeksy w tablicy jednowymiarowej/style.css
new file mode 100644
index 0000000..458b193
--- /dev/null
+++ b/Zadania/Z94 - max i indeksy w tablicy jednowymiarowej/style.css
@@ -0,0 +1,300 @@
+/* === UNIVERSAL SCHOOL TEMPLATE CSS (BLACK & WHITE EDITION) === */
+/* clean, modern, and copy-paste friendly for all projects */
+
+/* === RESET === */
+* {
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+}
+
+/* === VARIABLES === */
+:root {
+ --accent: #000;
+ --border: #000;
+ --bg: #fff;
+ --bg-alt: #f7f7f7;
+ --text: #111;
+ --shadow: rgba(0, 0, 0, 0.15) 3px 3px 6px;
+ --radius: 1em;
+ --max-width: 1300px;
+}
+
+/* === PAGE === */
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Verdana, sans-serif;
+ background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
+ color: var(--text);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ min-height: 100vh;
+ line-height: 1.6;
+}
+
+/* === HEADER === */
+header {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 20px 30px;
+ box-shadow: var(--shadow);
+ background: var(--bg);
+ width: 95%;
+ max-width: var(--max-width);
+ text-align: center;
+ margin-top: 25px;
+ transition: box-shadow 0.3s ease, transform 0.2s ease;
+}
+
+header:hover {
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+ transform: translateY(-2px);
+}
+
+header h1 {
+ font-size: 2.2rem;
+}
+
+header h2 {
+ margin-top: 0.5rem;
+ font-weight: 400;
+ font-size: 1.1rem;
+ color: #444;
+}
+
+/* === BOX === */
+.box {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 25px 35px;
+ margin-top: 25px;
+ background: var(--bg);
+ box-shadow: var(--shadow);
+ width: 95%;
+ max-width: var(--max-width);
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
+}
+
+.box:hover {
+ transform: translateY(-2px);
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+}
+
+/* === TEXT ELEMENTS === */
+p {
+ margin-bottom: 1rem;
+}
+
+.box > p:last-child {
+ margin-bottom: 0;
+}
+
+h1, h2, h3, h4 {
+ margin-bottom: 0.5rem;
+ font-weight: 600;
+}
+
+a {
+ color: #000;
+ text-decoration: underline;
+ font-weight: 500;
+}
+
+a:hover {
+ opacity: 0.7;
+}
+
+/* === LISTS === */
+ul, ol {
+ margin: 1rem 0 1rem 1.5rem;
+}
+
+li {
+ margin-bottom: 0.4rem;
+}
+
+/* === TABLES === */
+table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 1rem 0;
+ background: var(--bg);
+ border: 2px solid var(--border);
+ border-radius: 0.6em;
+ overflow: hidden;
+ box-shadow: var(--shadow);
+}
+
+th, td {
+ padding: 10px 12px;
+ border-bottom: 1px solid #ccc;
+ text-align: center;
+}
+
+th {
+ background: var(--bg-alt);
+ font-weight: bold;
+ text-align: left;
+}
+
+tr:hover {
+ background: #f2f2f2;
+}
+
+/* === FORMS === */
+form {
+ display: flex;
+ flex-direction: column;
+ gap: 1.4rem;
+}
+
+.box:has(> form) {
+ padding: 35px 35px;
+}
+
+fieldset {
+ border: 2px solid var(--border);
+ border-radius: 0.8em;
+ padding: 1.2rem 1.5rem;
+ background: var(--bg-alt);
+}
+
+legend {
+ font-weight: bold;
+ color: #000;
+ padding: 0 0.4rem;
+ font-size: 1.05rem;
+}
+
+label {
+ font-weight: 500;
+}
+
+input[type="text"],
+input[type="email"],
+input[type="password"],
+input[type="number"],
+input[type="tel"],
+input[type="date"],
+textarea,
+select {
+ width: 100%;
+ font-size: 1rem;
+ margin-top: 6px;
+ margin-bottom: 8px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ padding: 0.4rem 0.5rem;
+ transition: all 0.2s ease;
+ background: var(--bg);
+}
+
+textarea {
+ resize: vertical;
+ min-height: 100px;
+}
+
+input:focus,
+textarea:focus,
+select:focus {
+ outline: none;
+ border-color: #000;
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
+ background: #f9f9f9;
+}
+
+input[type="radio"],
+input[type="checkbox"] {
+ accent-color: #000;
+ transform: scale(1.2);
+ margin-right: 0.3rem;
+}
+
+/* === BUTTONS === */
+button,
+input[type="submit"],
+input[type="button"],
+input[type="reset"] {
+ padding: 10px 20px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ font-weight: bold;
+ font-size: 1rem;
+ background: linear-gradient(180deg, #fff 0%, #f2f2f2 100%);
+ cursor: pointer;
+ transition: all 0.2s ease;
+ align-self: flex-start;
+}
+
+button {
+ width: 100%;
+}
+
+button:hover,
+input[type="submit"]:hover,
+input[type="button"]:hover,
+input[type="reset"]:hover {
+ background: #eaeaea;
+ box-shadow: rgba(0, 0, 0, 0.25) 3px 3px 6px;
+ transform: translateY(-2px);
+}
+
+button:active,
+input[type="submit"]:active,
+input[type="button"]:active,
+input[type="reset"]:active {
+ transform: translateY(0);
+ box-shadow: rgba(0, 0, 0, 0.15) 1px 1px 3px;
+ background: #f7f7f7;
+}
+
+/* === HR, CODE, ETC. === */
+hr {
+ border: 0;
+ border-top: 2px solid var(--border);
+ margin: 1.5rem 0;
+}
+
+img {
+ max-width: 100%;
+ border-radius: 0.5em;
+}
+
+code, pre {
+ background: #f4f4f4;
+ border: 1px solid #ccc;
+ border-radius: 0.4em;
+ padding: 0.3em 0.5em;
+ font-family: "Courier New", monospace;
+}
+
+pre {
+ padding: 1em;
+ overflow-x: auto;
+}
+
+/* === RESPONSIVE === */
+@media (max-width: 900px) {
+ header, .box {
+ width: 95%;
+ padding: 20px;
+ }
+
+ button {
+ width: 100%;
+ }
+
+ textarea {
+ width: 100%;
+ }
+}
+
+@media (max-width: 600px) {
+ header h1 {
+ font-size: 1.7rem;
+ }
+
+ header h2 {
+ font-size: 0.95rem;
+ }
+}
diff --git a/Zadania/Z95 - max w tablicy dwuwymiarowej/index.php b/Zadania/Z95 - max w tablicy dwuwymiarowej/index.php
new file mode 100644
index 0000000..dbb3d54
--- /dev/null
+++ b/Zadania/Z95 - max w tablicy dwuwymiarowej/index.php
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+ Z95 - max w tablicy dwuwymiarowej
+
+
+
+
+ Zadanie Z95
+ Autor: Jakub Grzegorczyk
+
+
+
+ Napisz program, który wczytuje liczby całkowite do tablicy o wymiarach n x m, wyświetla tę tablicę i wyświetla maksymalną wartość zapisaną w tablicy. Użytkownik podaje n i m oraz wprowadza liczby do komponentu textarea oddzielone przecinkami. Program powinien zweryfikować, czy n i m są liczbami całkowitymi, czy podane wartości są liczbami całkowitymi, oraz czy ich liczba zgadza się z n x m, a następnie wyświetlić tablicę w czytelny sposób wraz z maksymalną wartością.
+
+ Uwaga: Do wygenerowania liczb oddzielonych przecinkami możesz wykorzystać zadanie z85.
+
+
Wskazówki dla ucznia:
+
+ Sprawdź, czy n i m są liczbami całkowitymi (is_numeric() i is_int() po konwersji).
+ Użyj explode(), aby rozdzielić ciąg z textarea na tablicę liczb na podstawie przecinków.
+ Zweryfikuj, czy każda wartość jest liczbą całkowitą za pomocą is_numeric() i sprawdzenia, czy po konwersji na int nie traci wartości dziesiętnej.
+ Przekształć jednowymiarową tablicę na dwuwymiarową, rozdzielając ją na wiersze po m elementów.
+ Użyj max() na spłaszczonej tablicy, aby znaleźć maksymalną wartość.
+ Zabezpiecz dane wejściowe za pomocą htmlspecialchars() przy pobieraniu, aby chronić przed XSS.
+
+
+
+
+
+ Wymiary tablicy
+ Liczba wierszy (n):
+
+ Liczba kolumn (m):
+
+
+
+ Wartości tablicy (liczby całkowite oddzielone przecinkami):
+
+
+
+ Wyślij
+
+
+ 0 && (int)$nInput <= 100 &&
+ (int)$mInput > 0 && (int)$mInput <= 100;
+
+ $n = (int)$nInput;
+ $m = (int)$mInput;
+
+ $values = array_map('trim', explode(',', $valuesInput));
+ $count = count($values);
+ $isCountValid = $count === ($n*$m);
+
+ $areAllValuesValid = true;
+ for ($i = 0; $i < $count; $i++) {
+ if (!is_numeric($values[$i])) {
+ $areAllValuesValid = false;
+ } else {
+ $values[$i] = (int)$values[$i];
+ }
+ }
+ echo '';
+ if ($areAllValuesValid && $isValidDimensions && $isCountValid) {
+ $values2d = array_chunk($values, $m);
+
+ echo "Wymiary tablicy: n = $n, m = $m
";
+ echo "Wprowadzone liczby: ";
+ echo implode(', ', $values);
+ echo "
Tablica $n x $m:";
+ echo '
';
+ for ($i = 0; $i < $n; $i++) {
+ echo '';
+ for ($j = 0; $j < $m; $j++) {
+ echo '' . $values2d[$i][$j] . ' ';
+ }
+ echo ' ';
+ }
+ echo '
';
+ echo "Maksymalna wartość: " . max($values) . '
';
+ } else {
+ echo 'Dane wejściowe nie są poprawne! Sprawdź wymiary, liczbę wartości lub czy wszystkie są liczbami.';
+ }
+ echo '';
+}
+?>
+
+
diff --git a/Zadania/Z95 - max w tablicy dwuwymiarowej/style.css b/Zadania/Z95 - max w tablicy dwuwymiarowej/style.css
new file mode 100644
index 0000000..458b193
--- /dev/null
+++ b/Zadania/Z95 - max w tablicy dwuwymiarowej/style.css
@@ -0,0 +1,300 @@
+/* === UNIVERSAL SCHOOL TEMPLATE CSS (BLACK & WHITE EDITION) === */
+/* clean, modern, and copy-paste friendly for all projects */
+
+/* === RESET === */
+* {
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+}
+
+/* === VARIABLES === */
+:root {
+ --accent: #000;
+ --border: #000;
+ --bg: #fff;
+ --bg-alt: #f7f7f7;
+ --text: #111;
+ --shadow: rgba(0, 0, 0, 0.15) 3px 3px 6px;
+ --radius: 1em;
+ --max-width: 1300px;
+}
+
+/* === PAGE === */
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Verdana, sans-serif;
+ background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
+ color: var(--text);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ min-height: 100vh;
+ line-height: 1.6;
+}
+
+/* === HEADER === */
+header {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 20px 30px;
+ box-shadow: var(--shadow);
+ background: var(--bg);
+ width: 95%;
+ max-width: var(--max-width);
+ text-align: center;
+ margin-top: 25px;
+ transition: box-shadow 0.3s ease, transform 0.2s ease;
+}
+
+header:hover {
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+ transform: translateY(-2px);
+}
+
+header h1 {
+ font-size: 2.2rem;
+}
+
+header h2 {
+ margin-top: 0.5rem;
+ font-weight: 400;
+ font-size: 1.1rem;
+ color: #444;
+}
+
+/* === BOX === */
+.box {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 25px 35px;
+ margin-top: 25px;
+ background: var(--bg);
+ box-shadow: var(--shadow);
+ width: 95%;
+ max-width: var(--max-width);
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
+}
+
+.box:hover {
+ transform: translateY(-2px);
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+}
+
+/* === TEXT ELEMENTS === */
+p {
+ margin-bottom: 1rem;
+}
+
+.box > p:last-child {
+ margin-bottom: 0;
+}
+
+h1, h2, h3, h4 {
+ margin-bottom: 0.5rem;
+ font-weight: 600;
+}
+
+a {
+ color: #000;
+ text-decoration: underline;
+ font-weight: 500;
+}
+
+a:hover {
+ opacity: 0.7;
+}
+
+/* === LISTS === */
+ul, ol {
+ margin: 1rem 0 1rem 1.5rem;
+}
+
+li {
+ margin-bottom: 0.4rem;
+}
+
+/* === TABLES === */
+table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 1rem 0;
+ background: var(--bg);
+ border: 2px solid var(--border);
+ border-radius: 0.6em;
+ overflow: hidden;
+ box-shadow: var(--shadow);
+}
+
+th, td {
+ padding: 10px 12px;
+ border-bottom: 1px solid #ccc;
+ text-align: center;
+}
+
+th {
+ background: var(--bg-alt);
+ font-weight: bold;
+ text-align: left;
+}
+
+tr:hover {
+ background: #f2f2f2;
+}
+
+/* === FORMS === */
+form {
+ display: flex;
+ flex-direction: column;
+ gap: 1.4rem;
+}
+
+.box:has(> form) {
+ padding: 35px 35px;
+}
+
+fieldset {
+ border: 2px solid var(--border);
+ border-radius: 0.8em;
+ padding: 1.2rem 1.5rem;
+ background: var(--bg-alt);
+}
+
+legend {
+ font-weight: bold;
+ color: #000;
+ padding: 0 0.4rem;
+ font-size: 1.05rem;
+}
+
+label {
+ font-weight: 500;
+}
+
+input[type="text"],
+input[type="email"],
+input[type="password"],
+input[type="number"],
+input[type="tel"],
+input[type="date"],
+textarea,
+select {
+ width: 100%;
+ font-size: 1rem;
+ margin-top: 6px;
+ margin-bottom: 8px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ padding: 0.4rem 0.5rem;
+ transition: all 0.2s ease;
+ background: var(--bg);
+}
+
+textarea {
+ resize: vertical;
+ min-height: 100px;
+}
+
+input:focus,
+textarea:focus,
+select:focus {
+ outline: none;
+ border-color: #000;
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
+ background: #f9f9f9;
+}
+
+input[type="radio"],
+input[type="checkbox"] {
+ accent-color: #000;
+ transform: scale(1.2);
+ margin-right: 0.3rem;
+}
+
+/* === BUTTONS === */
+button,
+input[type="submit"],
+input[type="button"],
+input[type="reset"] {
+ padding: 10px 20px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ font-weight: bold;
+ font-size: 1rem;
+ background: linear-gradient(180deg, #fff 0%, #f2f2f2 100%);
+ cursor: pointer;
+ transition: all 0.2s ease;
+ align-self: flex-start;
+}
+
+button {
+ width: 100%;
+}
+
+button:hover,
+input[type="submit"]:hover,
+input[type="button"]:hover,
+input[type="reset"]:hover {
+ background: #eaeaea;
+ box-shadow: rgba(0, 0, 0, 0.25) 3px 3px 6px;
+ transform: translateY(-2px);
+}
+
+button:active,
+input[type="submit"]:active,
+input[type="button"]:active,
+input[type="reset"]:active {
+ transform: translateY(0);
+ box-shadow: rgba(0, 0, 0, 0.15) 1px 1px 3px;
+ background: #f7f7f7;
+}
+
+/* === HR, CODE, ETC. === */
+hr {
+ border: 0;
+ border-top: 2px solid var(--border);
+ margin: 1.5rem 0;
+}
+
+img {
+ max-width: 100%;
+ border-radius: 0.5em;
+}
+
+code, pre {
+ background: #f4f4f4;
+ border: 1px solid #ccc;
+ border-radius: 0.4em;
+ padding: 0.3em 0.5em;
+ font-family: "Courier New", monospace;
+}
+
+pre {
+ padding: 1em;
+ overflow-x: auto;
+}
+
+/* === RESPONSIVE === */
+@media (max-width: 900px) {
+ header, .box {
+ width: 95%;
+ padding: 20px;
+ }
+
+ button {
+ width: 100%;
+ }
+
+ textarea {
+ width: 100%;
+ }
+}
+
+@media (max-width: 600px) {
+ header h1 {
+ font-size: 1.7rem;
+ }
+
+ header h2 {
+ font-size: 0.95rem;
+ }
+}
diff --git a/Zadania/Z96 - max i indeksy w tablicy dwuwymiarowej/index.php b/Zadania/Z96 - max i indeksy w tablicy dwuwymiarowej/index.php
new file mode 100644
index 0000000..454540e
--- /dev/null
+++ b/Zadania/Z96 - max i indeksy w tablicy dwuwymiarowej/index.php
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+ Z96 - max i indeksy w tablicy dwuwymiarowej
+
+
+
+
+ Zadanie Z96
+ Autor: Jakub Grzegorczyk
+
+
+
Napisz program, który wczytuje liczby całkowite do tablicy o wymiarach n x m, wyświetla tę tablicę, wyświetla maksymalną wartość zapisaną w tablicy oraz wskaźniki elementów zawierających tę maksymalną wartość. Użytkownik podaje n i m oraz wprowadza liczby do komponentu textarea oddzielone przecinkami. Program powinien zweryfikować, czy n i m są liczbami całkowitymi, czy podane wartości są liczbami całkowitymi, oraz czy ich liczba zgadza się z n x m, a następnie wyświetlić tablicę, maksymalną wartość i indeksy elementów o tej wartości.
+
Wskazówki dla ucznia:
+
+ Sprawdź, czy n i m są liczbami całkowitymi (is_numeric() i is_int() po konwersji).
+ Użyj explode(), aby rozdzielić ciąg z textarea na tablicę liczb na podstawie przecinków.
+ Zweryfikuj, czy każda wartość jest liczbą całkowitą za pomocą is_numeric() i sprawdzenia, czy po konwersji na int nie traci wartości dziesiętnej.
+ Przekształć jednowymiarową tablicę na dwuwymiarową, rozdzielając ją na wiersze po m elementów.
+ Użyj max(), aby znaleźć maksymalną wartość, a następnie przeszukaj tablicę dwuwymiarową, aby znaleźć indeksy (i, j) elementów z tą wartością.
+ Zabezpiecz dane wejściowe za pomocą htmlspecialchars() przy pobieraniu, aby chronić przed XSS.
+
+
+
+
+
+ Wymiary tablicy
+ Liczba wierszy (n):
+
+ Liczba kolumn (m):
+
+
+
+ Wartości tablicy (liczby całkowite oddzielone przecinkami):
+
+
+
+ Wyślij
+
+
+ 0 && (int)$nInput <= 100 &&
+ (int)$mInput > 0 && (int)$mInput <= 100;
+
+ $n = (int)$nInput;
+ $m = (int)$mInput;
+
+ $values = array_map('trim', explode(',', $valuesInput));
+ $count = count($values);
+ $isCountValid = $count === ($n*$m);
+
+ $areAllValuesValid = true;
+ for ($i = 0; $i < $count; $i++) {
+ if (!is_numeric($values[$i])) {
+ $areAllValuesValid = false;
+ } else {
+ $values[$i] = (int)$values[$i];
+ }
+ }
+ echo '';
+ if ($areAllValuesValid && $isValidDimensions && $isCountValid) {
+ $values2d = array_chunk($values, $m);
+ $maxIndexes = array();
+ for ($i = 0; $i < $n; $i++) {
+ for ($j = 0; $j < $m; $j++) {
+ if ($values2d[$i][$j] == max($values)) {
+ $maxIndexes[] = array($i, $j);
+ }
+ }
+ }
+ echo "Wymiary tablicy: n = $n, m = $m
";
+ echo "Wprowadzone liczby: ";
+ echo implode(', ', $values);
+ echo "
Tablica $n x $m:";
+ echo '
';
+ for ($i = 0; $i < $n; $i++) {
+ echo '';
+ for ($j = 0; $j < $m; $j++) {
+ echo '' . $values2d[$i][$j] . ' ';
+ }
+ echo ' ';
+ }
+ echo '
';
+ echo "Maksymalna wartość: " . max($values) . '
';
+ echo "Indeksy elementów z maksymalną wartością: ";
+ foreach ($maxIndexes as $index) {
+ echo "(" . $index[0] . ", " . $index[1] . ") ";
+ }
+ echo '
';
+ } else {
+ echo 'Dane wejściowe nie są poprawne! Sprawdź wymiary, liczbę wartości lub czy wszystkie są liczbami.';
+ }
+ echo '';
+}
+?>
+
+
diff --git a/Zadania/Z96 - max i indeksy w tablicy dwuwymiarowej/style.css b/Zadania/Z96 - max i indeksy w tablicy dwuwymiarowej/style.css
new file mode 100644
index 0000000..458b193
--- /dev/null
+++ b/Zadania/Z96 - max i indeksy w tablicy dwuwymiarowej/style.css
@@ -0,0 +1,300 @@
+/* === UNIVERSAL SCHOOL TEMPLATE CSS (BLACK & WHITE EDITION) === */
+/* clean, modern, and copy-paste friendly for all projects */
+
+/* === RESET === */
+* {
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+}
+
+/* === VARIABLES === */
+:root {
+ --accent: #000;
+ --border: #000;
+ --bg: #fff;
+ --bg-alt: #f7f7f7;
+ --text: #111;
+ --shadow: rgba(0, 0, 0, 0.15) 3px 3px 6px;
+ --radius: 1em;
+ --max-width: 1300px;
+}
+
+/* === PAGE === */
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Verdana, sans-serif;
+ background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
+ color: var(--text);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ min-height: 100vh;
+ line-height: 1.6;
+}
+
+/* === HEADER === */
+header {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 20px 30px;
+ box-shadow: var(--shadow);
+ background: var(--bg);
+ width: 95%;
+ max-width: var(--max-width);
+ text-align: center;
+ margin-top: 25px;
+ transition: box-shadow 0.3s ease, transform 0.2s ease;
+}
+
+header:hover {
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+ transform: translateY(-2px);
+}
+
+header h1 {
+ font-size: 2.2rem;
+}
+
+header h2 {
+ margin-top: 0.5rem;
+ font-weight: 400;
+ font-size: 1.1rem;
+ color: #444;
+}
+
+/* === BOX === */
+.box {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 25px 35px;
+ margin-top: 25px;
+ background: var(--bg);
+ box-shadow: var(--shadow);
+ width: 95%;
+ max-width: var(--max-width);
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
+}
+
+.box:hover {
+ transform: translateY(-2px);
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+}
+
+/* === TEXT ELEMENTS === */
+p {
+ margin-bottom: 1rem;
+}
+
+.box > p:last-child {
+ margin-bottom: 0;
+}
+
+h1, h2, h3, h4 {
+ margin-bottom: 0.5rem;
+ font-weight: 600;
+}
+
+a {
+ color: #000;
+ text-decoration: underline;
+ font-weight: 500;
+}
+
+a:hover {
+ opacity: 0.7;
+}
+
+/* === LISTS === */
+ul, ol {
+ margin: 1rem 0 1rem 1.5rem;
+}
+
+li {
+ margin-bottom: 0.4rem;
+}
+
+/* === TABLES === */
+table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 1rem 0;
+ background: var(--bg);
+ border: 2px solid var(--border);
+ border-radius: 0.6em;
+ overflow: hidden;
+ box-shadow: var(--shadow);
+}
+
+th, td {
+ padding: 10px 12px;
+ border-bottom: 1px solid #ccc;
+ text-align: center;
+}
+
+th {
+ background: var(--bg-alt);
+ font-weight: bold;
+ text-align: left;
+}
+
+tr:hover {
+ background: #f2f2f2;
+}
+
+/* === FORMS === */
+form {
+ display: flex;
+ flex-direction: column;
+ gap: 1.4rem;
+}
+
+.box:has(> form) {
+ padding: 35px 35px;
+}
+
+fieldset {
+ border: 2px solid var(--border);
+ border-radius: 0.8em;
+ padding: 1.2rem 1.5rem;
+ background: var(--bg-alt);
+}
+
+legend {
+ font-weight: bold;
+ color: #000;
+ padding: 0 0.4rem;
+ font-size: 1.05rem;
+}
+
+label {
+ font-weight: 500;
+}
+
+input[type="text"],
+input[type="email"],
+input[type="password"],
+input[type="number"],
+input[type="tel"],
+input[type="date"],
+textarea,
+select {
+ width: 100%;
+ font-size: 1rem;
+ margin-top: 6px;
+ margin-bottom: 8px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ padding: 0.4rem 0.5rem;
+ transition: all 0.2s ease;
+ background: var(--bg);
+}
+
+textarea {
+ resize: vertical;
+ min-height: 100px;
+}
+
+input:focus,
+textarea:focus,
+select:focus {
+ outline: none;
+ border-color: #000;
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
+ background: #f9f9f9;
+}
+
+input[type="radio"],
+input[type="checkbox"] {
+ accent-color: #000;
+ transform: scale(1.2);
+ margin-right: 0.3rem;
+}
+
+/* === BUTTONS === */
+button,
+input[type="submit"],
+input[type="button"],
+input[type="reset"] {
+ padding: 10px 20px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ font-weight: bold;
+ font-size: 1rem;
+ background: linear-gradient(180deg, #fff 0%, #f2f2f2 100%);
+ cursor: pointer;
+ transition: all 0.2s ease;
+ align-self: flex-start;
+}
+
+button {
+ width: 100%;
+}
+
+button:hover,
+input[type="submit"]:hover,
+input[type="button"]:hover,
+input[type="reset"]:hover {
+ background: #eaeaea;
+ box-shadow: rgba(0, 0, 0, 0.25) 3px 3px 6px;
+ transform: translateY(-2px);
+}
+
+button:active,
+input[type="submit"]:active,
+input[type="button"]:active,
+input[type="reset"]:active {
+ transform: translateY(0);
+ box-shadow: rgba(0, 0, 0, 0.15) 1px 1px 3px;
+ background: #f7f7f7;
+}
+
+/* === HR, CODE, ETC. === */
+hr {
+ border: 0;
+ border-top: 2px solid var(--border);
+ margin: 1.5rem 0;
+}
+
+img {
+ max-width: 100%;
+ border-radius: 0.5em;
+}
+
+code, pre {
+ background: #f4f4f4;
+ border: 1px solid #ccc;
+ border-radius: 0.4em;
+ padding: 0.3em 0.5em;
+ font-family: "Courier New", monospace;
+}
+
+pre {
+ padding: 1em;
+ overflow-x: auto;
+}
+
+/* === RESPONSIVE === */
+@media (max-width: 900px) {
+ header, .box {
+ width: 95%;
+ padding: 20px;
+ }
+
+ button {
+ width: 100%;
+ }
+
+ textarea {
+ width: 100%;
+ }
+}
+
+@media (max-width: 600px) {
+ header h1 {
+ font-size: 1.7rem;
+ }
+
+ header h2 {
+ font-size: 0.95rem;
+ }
+}
diff --git a/Zadania/Z97 - suma w wierszu tablicy/index.php b/Zadania/Z97 - suma w wierszu tablicy/index.php
new file mode 100644
index 0000000..f0217fd
--- /dev/null
+++ b/Zadania/Z97 - suma w wierszu tablicy/index.php
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+ Z97 - suma w wierszu tablicy
+
+
+
+
+ Zadanie Z97
+ Autor: Jakub Grzegorczyk
+
+
+
Napisz program, który wczytuje liczby do tablicy o wymiarach n x m i oblicza sumę wartości we wskazanym wierszu. Numer wiersza podaje użytkownik (numerowanie od 0). Użytkownik wprowadza n, m, liczby do komponentu textarea oddzielone przecinkami oraz numer wiersza. Program powinien zweryfikować, czy n, m i numer wiersza są liczbami całkowitymi, czy podane wartości są liczbami, czy ich liczba zgadza się z n x m, a następnie wyświetlić tablicę i sumę wartości w wybranym wierszu.
+
Wskazówki dla ucznia:
+
+ Sprawdź, czy n i m są liczbami całkowitymi (is_numeric() i is_int() po konwersji).
+ Użyj explode(), aby rozdzielić ciąg z textarea na tablicę liczb na podstawie przecinków.
+ Zweryfikuj, czy każda wartość jest liczbą całkowitą za pomocą is_numeric() i sprawdzenia, czy po konwersji na int nie traci wartości dziesiętnej.
+ Przekształć jednowymiarową tablicę na dwuwymiarową, rozdzielając ją na wiersze po m elementów.
+ Użyj array_sum() lub pętli, aby obliczyć sumę wartości w wybranym wierszu.
+ Zabezpiecz dane wejściowe za pomocą htmlspecialchars() przy pobieraniu, aby chronić przed XSS.
+
+
+
+
+
+ Wymiary tablicy
+ Liczba wierszy (n):
+
+ Liczba kolumn (m):
+
+ Numer wiersza (0 do n-1):
+
+
+
+ Wartości tablicy (liczby całkowite oddzielone przecinkami):
+
+
+
+ Wyślij
+
+
+ 0 && (int)$nInput <= 100 &&
+ (int)$mInput > 0 && (int)$mInput <= 100;
+
+ $n = (int)$nInput;
+ $m = (int)$mInput;
+ $rowNum = (int)$rowNumInput;
+
+ $values = array_map('trim', explode(',', $valuesInput));
+ $count = count($values);
+ $isCountValid = $count === ($n*$m);
+
+ $areAllValuesValid = true;
+ for ($i = 0; $i < $count; $i++) {
+ if (!is_numeric($values[$i])) {
+ $areAllValuesValid = false;
+ } else {
+ $values[$i] = (int)$values[$i];
+ }
+ }
+ echo '';
+ if ($areAllValuesValid && $isValidDimensions && $isCountValid) {
+ $values2d = array_chunk($values, $m);
+ echo "Wymiary tablicy: n = $n, m = $m
";
+ echo "Wprowadzone liczby: ";
+ echo implode(', ', $values);
+ echo "
Tablica $n x $m:";
+ echo '
';
+ for ($i = 0; $i < $n; $i++) {
+ echo '';
+ for ($j = 0; $j < $m; $j++) {
+ echo '' . $values2d[$i][$j] . ' ';
+ }
+ echo ' ';
+ }
+ echo '
';
+ echo 'Suma wartości w wierszu ' . $rowNum . ': ' . array_sum($values2d[$rowNum]) . '
';
+ echo '
';
+ } else {
+ echo 'Dane wejściowe nie są poprawne! Sprawdź wymiary, liczbę wartości lub czy wszystkie są liczbami.';
+ }
+ echo '';
+}
+?>
+
+
diff --git a/Zadania/Z97 - suma w wierszu tablicy/style.css b/Zadania/Z97 - suma w wierszu tablicy/style.css
new file mode 100644
index 0000000..458b193
--- /dev/null
+++ b/Zadania/Z97 - suma w wierszu tablicy/style.css
@@ -0,0 +1,300 @@
+/* === UNIVERSAL SCHOOL TEMPLATE CSS (BLACK & WHITE EDITION) === */
+/* clean, modern, and copy-paste friendly for all projects */
+
+/* === RESET === */
+* {
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
+}
+
+/* === VARIABLES === */
+:root {
+ --accent: #000;
+ --border: #000;
+ --bg: #fff;
+ --bg-alt: #f7f7f7;
+ --text: #111;
+ --shadow: rgba(0, 0, 0, 0.15) 3px 3px 6px;
+ --radius: 1em;
+ --max-width: 1300px;
+}
+
+/* === PAGE === */
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Verdana, sans-serif;
+ background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
+ color: var(--text);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ min-height: 100vh;
+ line-height: 1.6;
+}
+
+/* === HEADER === */
+header {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 20px 30px;
+ box-shadow: var(--shadow);
+ background: var(--bg);
+ width: 95%;
+ max-width: var(--max-width);
+ text-align: center;
+ margin-top: 25px;
+ transition: box-shadow 0.3s ease, transform 0.2s ease;
+}
+
+header:hover {
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+ transform: translateY(-2px);
+}
+
+header h1 {
+ font-size: 2.2rem;
+}
+
+header h2 {
+ margin-top: 0.5rem;
+ font-weight: 400;
+ font-size: 1.1rem;
+ color: #444;
+}
+
+/* === BOX === */
+.box {
+ border: 2px solid var(--border);
+ border-radius: var(--radius);
+ padding: 25px 35px;
+ margin-top: 25px;
+ background: var(--bg);
+ box-shadow: var(--shadow);
+ width: 95%;
+ max-width: var(--max-width);
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
+}
+
+.box:hover {
+ transform: translateY(-2px);
+ box-shadow: rgba(0, 0, 0, 0.25) 4px 4px 10px;
+}
+
+/* === TEXT ELEMENTS === */
+p {
+ margin-bottom: 1rem;
+}
+
+.box > p:last-child {
+ margin-bottom: 0;
+}
+
+h1, h2, h3, h4 {
+ margin-bottom: 0.5rem;
+ font-weight: 600;
+}
+
+a {
+ color: #000;
+ text-decoration: underline;
+ font-weight: 500;
+}
+
+a:hover {
+ opacity: 0.7;
+}
+
+/* === LISTS === */
+ul, ol {
+ margin: 1rem 0 1rem 1.5rem;
+}
+
+li {
+ margin-bottom: 0.4rem;
+}
+
+/* === TABLES === */
+table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 1rem 0;
+ background: var(--bg);
+ border: 2px solid var(--border);
+ border-radius: 0.6em;
+ overflow: hidden;
+ box-shadow: var(--shadow);
+}
+
+th, td {
+ padding: 10px 12px;
+ border-bottom: 1px solid #ccc;
+ text-align: center;
+}
+
+th {
+ background: var(--bg-alt);
+ font-weight: bold;
+ text-align: left;
+}
+
+tr:hover {
+ background: #f2f2f2;
+}
+
+/* === FORMS === */
+form {
+ display: flex;
+ flex-direction: column;
+ gap: 1.4rem;
+}
+
+.box:has(> form) {
+ padding: 35px 35px;
+}
+
+fieldset {
+ border: 2px solid var(--border);
+ border-radius: 0.8em;
+ padding: 1.2rem 1.5rem;
+ background: var(--bg-alt);
+}
+
+legend {
+ font-weight: bold;
+ color: #000;
+ padding: 0 0.4rem;
+ font-size: 1.05rem;
+}
+
+label {
+ font-weight: 500;
+}
+
+input[type="text"],
+input[type="email"],
+input[type="password"],
+input[type="number"],
+input[type="tel"],
+input[type="date"],
+textarea,
+select {
+ width: 100%;
+ font-size: 1rem;
+ margin-top: 6px;
+ margin-bottom: 8px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ padding: 0.4rem 0.5rem;
+ transition: all 0.2s ease;
+ background: var(--bg);
+}
+
+textarea {
+ resize: vertical;
+ min-height: 100px;
+}
+
+input:focus,
+textarea:focus,
+select:focus {
+ outline: none;
+ border-color: #000;
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
+ background: #f9f9f9;
+}
+
+input[type="radio"],
+input[type="checkbox"] {
+ accent-color: #000;
+ transform: scale(1.2);
+ margin-right: 0.3rem;
+}
+
+/* === BUTTONS === */
+button,
+input[type="submit"],
+input[type="button"],
+input[type="reset"] {
+ padding: 10px 20px;
+ border: 2px solid var(--border);
+ border-radius: 0.5em;
+ font-weight: bold;
+ font-size: 1rem;
+ background: linear-gradient(180deg, #fff 0%, #f2f2f2 100%);
+ cursor: pointer;
+ transition: all 0.2s ease;
+ align-self: flex-start;
+}
+
+button {
+ width: 100%;
+}
+
+button:hover,
+input[type="submit"]:hover,
+input[type="button"]:hover,
+input[type="reset"]:hover {
+ background: #eaeaea;
+ box-shadow: rgba(0, 0, 0, 0.25) 3px 3px 6px;
+ transform: translateY(-2px);
+}
+
+button:active,
+input[type="submit"]:active,
+input[type="button"]:active,
+input[type="reset"]:active {
+ transform: translateY(0);
+ box-shadow: rgba(0, 0, 0, 0.15) 1px 1px 3px;
+ background: #f7f7f7;
+}
+
+/* === HR, CODE, ETC. === */
+hr {
+ border: 0;
+ border-top: 2px solid var(--border);
+ margin: 1.5rem 0;
+}
+
+img {
+ max-width: 100%;
+ border-radius: 0.5em;
+}
+
+code, pre {
+ background: #f4f4f4;
+ border: 1px solid #ccc;
+ border-radius: 0.4em;
+ padding: 0.3em 0.5em;
+ font-family: "Courier New", monospace;
+}
+
+pre {
+ padding: 1em;
+ overflow-x: auto;
+}
+
+/* === RESPONSIVE === */
+@media (max-width: 900px) {
+ header, .box {
+ width: 95%;
+ padding: 20px;
+ }
+
+ button {
+ width: 100%;
+ }
+
+ textarea {
+ width: 100%;
+ }
+}
+
+@media (max-width: 600px) {
+ header h1 {
+ font-size: 1.7rem;
+ }
+
+ header h2 {
+ font-size: 0.95rem;
+ }
+}