输出测试贴.
Ac
posted @ Feb 08, 2010 04:05:54 AM
in 游戏编程
, 2921 阅读


#include <iostream>
#include <math.h>
class Cvect{
public:
int x,y;
Cvect(int tx,int ty):x(tx),y(ty){}
int det(Cvect &b){return x*b.y-y*b.x;}
int dist(Cvect &b){return sqrt((b.x-x)*(b.x-x)+(b.y-y)*(b.y-y));}
};
int main(int argc,char** argv)
{
Cvect a(10,20),Cvect b(5,30);
std::cout<<"a det b is "<<a.det(b)
<<"\nb det a is "<<b.det(a)
<<"\ndist of a to b "<<a.dist(b)<<std::endl;
return 0;
}
Tex,syntax测试..
Feb 08, 2010 05:46:25 AM
沙发测试贴..
Feb 08, 2010 08:08:32 AM
板凳测试贴..
Feb 08, 2010 08:09:38 AM
地板测试贴..