Pages

2012/07/16

Code view style test

如何在Google Blogger 中加入程式碼瀏覽區段, 可以參考此連結
adding-syntax-highlighter-to-blogger

float DistancePointToPoint(Point3f Point1, Point3f Point2)
{
 float Distance;

 Distance = sqrt( (Point1.x-Point2.x)*(Point1.x-Point2.x) + 
     (Point1.y-Point2.y)*(Point1.y-Point2.y) + 
     (Point1.z-Point2.z)*(Point1.z-Point2.z));

  return Distance;
}
在HTML中看起來就會像是
<pre class="brush:cpp">
float DistancePointToPoint(Point3f Point1, Point3f Point2)
{
 float Distance;

 Distance = sqrt( (Point1.x-Point2.x)*(Point1.x-Point2.x) + 
     (Point1.y-Point2.y)*(Point1.y-Point2.y) + 
     (Point1.z-Point2.z)*(Point1.z-Point2.z));

  return Distance;
}
</pre>

No comments:

Post a Comment