分类:
2010-03-13 08:09:42
if (bSet == NULL)
{
...
} |
int i = 0;
for (i = 0; i < N; i++)
{
....
} |
$n* = 0; (以tab键对齐)
$ch* = 0;
$str* = “”; |
///////////////////////////////////////////////////////////////////////
// 函数名 : PrintArray
// 功能描述 : 打印数组
// 参数 : $arr ;数组名
// 返回值 :
/////////////////////////////////////////////////////////////////////// |
见最后部分 |
见最后部分 |
//////////////////////////////////////////////////////////////////////////////////
//文件名称: file.php
//创建日期: 2006/04/19
//功能说明: 打印数组
//作 者: andylin
//版本号: 1.0.0.1
////////////////////////////////////////////////////////////////////////////////////// |
//数据库类操作
requireonce(“./class/Db.php”); |
////////////////////////////////////////////////////
//文件名称: CPoint.php
//创建日期: 2007/02/01
//功能说明: 关于点的操作的类
//作 者: andylin
//版本号: 1.0.0.1
////////////////////////////////////////////////////
////////////////////////////////////////////////////
// 修改日期: :2007/03/01
// 修改人: :andylin
// 版本号: :1.0.02
// 修改目的
/*
添加了PrintPoint方法
*/
////////////////////////////////////////////////////
// 版本号 + modify start (by 作者)
// 版本号 + modify end(by 作者)
requireonce("./math.php");
namespace Math
{
class CPoint extends CObject
{
//构造函数 (最好把构造函数和析构函数放在最前面
public function _constructor($nx, $ny)
{
$x = $nx;
$y = $ny;
}
//析构函数
public function _destructor()
{
}
//1.0.0.2 modefy start(by andylin)
///////////////////////////////////////////////////////////////////////
// 函数名 : PrintPoint
// 功能描述 : 打印Point的x,y
// 参数 : 如果n == 1 print x 如果 n == 2 print y 否则print x, y
// 返回值 : 无
///////////////////////////////////////////////////////////////////////
//类似上面的声明,如果函数复杂应该要写,否者可以不写。比如下面的几个函数很简单就可以不写
public function PrintPoint($n)
{
if ($n == 1)
{
echo "x = ", x;
}
else if ($n == 2)
{
echo "y = ", y;
}
else
{
echo "x = ", x;
echo "y = ", y;
}
}
//1.0.0.2 modefy end(by andylin)
public function SetX($nx)
{
$this->x = $nx;
}
public function SetY($ny)
{
$this->y = $ny;
}
public function GetX()
{
return $this->x;
}
public function GetY()
{
return $this->y;
}
//Data Session
private $x = 0; //特殊的如i, j, k, x, y, n之类的可以不按命名规则。
private $y = 0 //否者,应当遵循。
};
};
|