情報処理実習3B(Web)

2019年度 前期 木04 15:15-16:45 瀬田3-B106

課題

04.loops/loop2.php

表示
ソース

<!DOCTYPE html>
<html lang="ja">
<head>
   <meta charset="UTF-8" />
   <title>多重ループ</title>
</head>
<body>
<h1>多重ループ</h1>
<?php
for($i = 0; $i < 10; $i++){
    for($j = 0; $j < 10; $j++){
        print "[{$i}{$j}]";
    }
    print '<br>';
}
?>
<hr>
<?php
for($i = 9; $i >= 0; $i--){
    for($j = 0; $j < $i; $j++){
        print "[{$i}{$j}]";
    }
    print '<br>';
}
?>
<hr>
<?php
for($i = 9; $i >= 0; $i--){
    for($j = 9; $j > $i; $j--){
        print "[{$i}{$j}]";
    }
    print '<br>';
}
?>
</body>
</html>