This commit is contained in:
louiscklaw
2025-01-31 19:15:17 +08:00
parent 09adae8c8e
commit 6c60a73f30
1546 changed files with 286918 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lab02 Task1</title>
</head>
<body>
<?php
for ($i=1; $i < 11; $i++) {
printf("%s * %s is %d<br>", $i, $i, ($i*$i));
}
?>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lab02 Task2</title>
</head>
<body>
<?php
$mathMark = array(70, 40, 60, 50, 20, 30, 10, 100, 80, 90);
$i = 0;
do {
echo "$mathMark[$i] ";
$i++;
} while ($i < count($mathMark) );
$max = $mathMark[0];
$i = 1;
while($i < count($mathMark)){
if ($max < $mathMark[$i])
$max = $mathMark[$i];
$i++;
}
printf("<br>Maximum mark: %d", $max);
$min = $mathMark[0];
for($i = 1; $i < count($mathMark); $i++){
if($min > $mathMark[$i])
$min = $mathMark[$i];
}
printf("<br>Minimum mark: %d", $min);
?>
</body>
</html>

View File

@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lab02 Task3</title>
</head>
<body>
<?php
$num = array(1, 1);
?>
<table border="1">
<?php
for($i=1; $i < 20; $i++){
echo "<tr>";
printf("<td>%d</td>", $num[$i-1]);
printf("<td>%d</td>", $num[$i]);
printf("<td>%d</td>", $num[$i-1]+$num[$i]);
echo "</tr>";
array_push($num, $num[$i-1]+$num[$i]);
}
?>
</table>
</body>
</html>