-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
34 lines (31 loc) · 800 Bytes
/
Copy pathindex.php
File metadata and controls
34 lines (31 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
function Fibonachi($n)
{
if ($n == 1) return 1;
if ($n == 2) return 1;
if ($n >= 3) return Fibonachi($n - 1) + Fibonachi($n - 2);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Задание №2 - числа Фибоначчи </title>
</head>
<body>
<form action="index.php" method="get">
<b>Введите число N: </b>
<input type="text" name="press">
<input type="submit" value="send"><br><br>
<? $a = ($_GET['press']);
for ($i = 0; $i <= $a; $i++) {
echo Fibonachi($i);
echo " ";
}
?>
</form>
<a href="hw.php">Не домашнее задание </a>
<a href="hw3.php">Домашнее задание №3</a>
<a href="login.php">Авторизация/Регистрация</a>
</body>
</html>