This commit is contained in:
jakub
2025-05-23 12:08:39 +02:00
parent 6a984cc17b
commit 0fb58def1a
6 changed files with 276 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<!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>Z71 - Ile liczb</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Zadanie Z71</h1>
<h2>Autor: Jakub Grzegorczyk</h2>
</header>
<div class="box">
Napisz program, który dla podanej liczby całkowitej większej od zera odpowie ile ma ona cyfr.
</div>
<div class="box">
<form action="index.php" method="post">
<label for="a">Podaj liczbę: </label><br>
<input type="number" name="a" id="a"><br><br>
<button type="submit">Wyślij</button>
</form>
</div>
<div class="box">
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$a = (int)htmlspecialchars($_POST['a']);
$liczbaCyfr = strlen($a);
echo "Liczba cyfr: $liczbaCyfr";
}
?>
</div>
</body>
</html>

View File

@@ -0,0 +1,51 @@
* {
box-sizing: border-box;
}
body {
font-family: Verdana, serif;
background: #ffffff;
margin: 30px;
}
header {
border: 2px solid black;
border-radius: 1em;
padding: 20px;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
background: #f0f0f0;
}
div {
border: 2px solid black;
padding: 20px;
border-radius: 1em;
margin: 10px 0 10px 0;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
}
input {
margin-top: 10px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
height: 2em;
}
button {
padding: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
font-weight: bold;
}
pre {
font-family: Verdana, serif;
}
.box p {
padding: 10px 15px 20px;
display: none;
}
.box h3 {
cursor: pointer;
}

View File

@@ -0,0 +1,42 @@
<!doctype html>
<html lang="en">
<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>Z76 - Od A do B</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Zadanie Z76</h1>
<h2>Autor: Jakub Grzegorczyk</h2>
</header>
<div class="box">
<p>Napisz program, który dla podanych liczb całkowitych A i B wyświetla wszystkie liczby całkowite z przedziału od A do B oddzielone średnikami.</p>
</div>
<div class="box">
<form action="index.php" method="post">
<label for="a">Wprowadź liczbę A: </label><br>
<input type="number" name="a" id="a"><br>
<label for="b">Wprowadź liczbę B:</label><br>
<input type="number" name="b" id="b"><br><br>
<button type="submit">Wyślij</button>
</form>
</div>
<div class="box">
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$a = (int)htmlspecialchars($_POST['a']);
$b = (int)htmlspecialchars($_POST['b']);
$liczby = [];
for ($i = $a; $i <= $b; $i++) {
$liczby[] = $i;
}
echo implode('; ', $liczby);
}
?>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
* {
box-sizing: border-box;
}
body {
font-family: Verdana, serif;
background: #ffffff;
margin: 30px;
}
header {
border: 2px solid black;
border-radius: 1em;
padding: 20px;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
background: #f0f0f0;
}
div {
}
input {
margin-top: 10px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
height: 2em;
}
button {
padding: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
font-weight: bold;
}
pre {
font-family: Verdana, serif;
}
.box {
border: 2px solid black;
padding: 20px;
border-radius: 1em;
margin: 10px 0 10px 0;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
}
.box h3 {
cursor: pointer;
}

View File

@@ -0,0 +1,47 @@
<!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>Z77 - Od mniejszej do większej</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Zadanie Z77</h1>
<h2>Autor: Jakub Grzegorczyk</h2>
</header>
<div class="box">
<p>Napisz program, który dla podanych liczb całkowitych A i B wyświetla liczby od A do B, gdy A < B, lub od B do A, gdy B < A.</p>
</div>
<div class="box">
<form action="index.php" method="post">
<label for="a">Wprowadź liczbę A:</label><br>
<input type="number" name="a" id="a"><br>
<label for="b">Wprowadź liczbę B:</label><br>
<input type="number" name="b" id="b"><br><br>
<button type="submit">Wyślij</button>
</form>
</div>
<div class="box">
<?php
if (isset($_POST['a']) && isset($_POST['b'])) {
$a = (int)htmlspecialchars($_POST['a']);
$b = (int)htmlspecialchars($_POST['b']);
if ($a < $b) {
for ($i = $a; $i <= $b; $i++) {
echo "$i ";
}
}
if ($b < $a) {
for ($i = $b; $i <= $a; $i++) {
echo "$i ";
}
}
}
?>
</div>
</body>
</html>

View File

@@ -0,0 +1,50 @@
* {
box-sizing: border-box;
}
body {
font-family: Verdana, serif;
background: #ffffff;
margin: 30px;
}
header {
border: 2px solid black;
border-radius: 1em;
padding: 20px;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
background: #f0f0f0;
}
div {
}
input {
margin-top: 10px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
height: 2em;
}
button {
padding: 5px;
width: 30%;
border: black 2px solid;
border-radius: 0.5em;
font-weight: bold;
}
pre {
font-family: Verdana, serif;
}
.box {
border: 2px solid black;
padding: 20px;
border-radius: 1em;
margin: 10px 0 10px 0;
box-shadow: rgba(0, 0, 0, 0.2) 3px 3px 5px;
}
.box h3 {
cursor: pointer;
}