This commit is contained in:
jakub
2025-10-31 22:15:27 +01:00
parent 1c1e77cf14
commit 1f7ddfd4a0
18 changed files with 3149 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<!doctype html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Z82 - Prostoką† X</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Zadanie Z82</h1>
<h2>Autor: Jakub Grzegorczyk</h2>
</header>
<div class="box">
<p>Napisz program, który dla danej liczby A i B wyświetla następujący blok znaków.</p>
<pre>
Przykład:
A ilość znaków w wierszu: 5
B ilość wierszy: 3
Wynik
XXXXX
XXXXX
XXXXX
</pre>
</div>
<div class="box">
<form action="index.php" method="post">
<fieldset>
<label for="a">Podaj A:</label>
<input type="text" name="a" id="a">
<label for="b">Podaj B:</label>
<input type="text" name="b" id="b">
</fieldset>
<button type="submit">Wyślij</button>
</form>
</div>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$a = htmlspecialchars($_POST['a']);
$b = htmlspecialchars($_POST['b']);
echo '<div class="box">'
. "A - ilość znaków w wierszu: $a <br>"
. "B - ilość wierszy: $b <br>";
for ($i = 0; $i < $b; $i++) {
echo str_repeat('X', $a);
echo '<br>';
}
echo '</div>';
}
?>
</body>
</html>