- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>0505</title>
- </head>
- <body>
- <?
- $a = 3 ;
- $b = 4 ;
- $c = 5 ;
-
- if($a==$b && $b==$c){
- echo "等邊三角形";
- }elseif($a==$b||$b==$c){
- if($a*$a+$b*$b==$c*$c){
- echo "等腰直角三角形";
- }else{
- echo "等腰三角形";
- }
- }elseif($a*$a+$b*$b==$c*$c){
- echo "直角三角形";
- }elseif($a*$a+$b*$b<$c*$c){
- echo "鈍角三角形";
- }elseif( pow($a,2)+pow($b,2)>pow($c,2) ){
- echo "銳角三角形";
- }
-
- ?>
- </body>
- </html>
複製代碼 |