看板 ZooStudy 關於我們 聯絡資訊
<html> <body> <? $count=-6; for(;$count<=5;$count++) { if($count==0) continue; $val=3000/$count; echo "3000 devided by $count is $val.<br>"; } ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <? $count=-6; for(;$count<=5;$count++) { if($count==0) break; $val=3000/$count; echo "3000 devided by $count is $val.<br>"; } ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <form method="post" action="1.php"> 1:<input type="text" name="val1"><br> 2:<input type="text" name="val2"><br> 3:<input type="text" name="val3"><br> 4:<input type="text" name="val4"><br> 5:<input type="text" name="val5"><br> <input type="submit" value="caculate"><br> <input type="reset" value="reset"><br> <? $sum=$val1; $min=$val1; $max=$val1; for($count=2;$count<=5;$count++) { $val= "val$count"; $sum= $sum+$$val; if ($min>$$val) $min=$$val; if ($max<$$val) $max=$$val; } $ave=$sum/5; $range= $max-$min; echo "min=$min<br>"; echo "max=$max<br>"; echo "range=$range<br>"; echo "average=$ave<br>"; echo "sum=$sum<br>"; ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <? echo "<table border=1>"; for($ii=1;$ii<=5;$ii+=1) { echo "<tr>"; for($iii=1;$iii<=5;$iii+=1) { echo "<TD>($ii,$iii)</TD>"; } echo "</tr>"; } echo "</table>" ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <? $aa=1; while($aa<8) { echo "<font size=$aa>size=$aa </font><br>"; $aa+=1; } for($a=7;$a>=1;$a-=1) { echo "<font size=$a>size=$a </font><br>"; } ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> 你的興趣有:<br> <form method="post" action="1.php"> 1:<input type="text" name="Love1"><br> 2:<input type="text" name="Love2"><br> 3:<input type="text" name="Love3"><br> <input type="submit" value="caculate"><br> <input type="reset" value="reset"><br> <? $I=1; $Love="Love$I"; while(!empty($$Love)) { echo "<LI>".$$Love."</LI>"; $I++; $Love="Love$I"; } ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <form method="post" action="1.php"> age:<input type="text" name="age"><br> <input type="submit" value="caculate"><br> <input type="reset" value="reset"><br> <? switch(intval($age)) { case 0: case 1: case 2: case 3: case 4: case 5: $s="普遍及"; break; case 6: case 7: case 8: case 9: case 10: case 11: $s="保護及"; break; case 12: case 13: case 14: case 15: case 16: case 17: $s="輔導及"; break; default: $s="限制及"; break; } echo "$age 可看 $s 電影<br>"; ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <form method="post" action="1.php"> number1:<input type="text" name="nnone"><br> number2:<input type="text" name="nntwo"><br> <input type="submit" value="caculate"><br> <input type="reset" value="reset"><br> <br> <? echo "number1=$nnone<br>"; echo "number2=$nntwo<br>"; $nnthree = ($nnone >= $nntwo) ? $nnone:$nntwo; echo "$nnthree is the larger one."; ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <form method="post" action="1.php"> number1:<input type="text" name="none"><br> number2:<input type="text" name="ntwo"><br> <input type="submit" value="caculate"><br> <input type="reset" value="reset"><br> <br> <? echo "number1=$none<br>"; echo "number2=$ntwo<br>"; if($none == $ntwo) { echo "the two numbers are the same.<br>"; } else if($none > $ntwo) { echo "number1($none) is larger than number2($ntwo).<br>"; } else { echo "number1($none) is smaller than number2($ntwo).<br>"; } ?> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <form method="post" action="1.php"> id:<input type="text" name="username"><br> password:<input type="password" name="userpass"><br> <input type="submit" value="caculate"><br> <input type="reset" value="reset"><br> <br> <? echo "username=$username<br>"; echo "password=$userpass<br>"; if($username == $userpass) { echo "u have chosen the password same as your user name.<br>"; } else { echo "it's not the same.<br>"; } ?> </body> </html> -- ※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw) ◆ From: 140.112.7.59