您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

很简单的有关问题,就是不知道为什么

2025/4/23 18:16:42发布17次查看
很简单的问题,就是不知道为什么?
index.php
php code 计算
周长面积计算
正方形 || 三角形 || 圆形
form.class.php
php codeshape=isset($_request[id]) ? $_request[id]:rect; } function __tostring(){ $form='
'; switch($this->shape){ case rect: $form.=$this->getrect(); break; case triangle: $form.=$this->gettriangle(); break; case circle: $form.=$this->getcircle(); break; default: echo '没有这个图形'; } $form.=''; $form.=''; return $form; } private function getrect(){ $input='请输入矩形的宽高
'; $input.='宽度:
'; $input.='高度:
'; return $input; } private function gettriangle(){ $input='请输入三角形的三边
'; $input.='第一边:
'; $input.='第二边:
'; $input.='第三边:
'; return $input; } private function getcircle(){ $input='请输入圆的半径
'; $input.='半径:
'; return $input; } }?>
--------------------
点三角形的时候,为什么会输出‘没有这个图形’,那里写错了?
------解决方案--------------------
id=triangle
case triangle:
=====================
understand
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product