C++言語などのソースコードをHTML文書内でハイライト表示させる「SyntaxHighlighter」
WEB上でC言語などのコンピュータ言語を表示させる時に、 見栄えよくしてくれるツール「SyntaxHighlighter」の紹介です。 本ツールは、javascript と css で実現されています。
使用前
class Matrix{//行列計算用のクラス
private:
complex<double> a[2][2];
public:
void Set(int i,int j, complex<double> k)
{
a[i][j] = k;
}
complex<double> Get(int i,int j)
{
return a[i][j];
}
Matrix operator*(Matrix& c)
{
Matrix temp;
int i,j,k;
for(i=0; i<2; i++){
for(j=0; j<2; j++){
temp.a[i][j] =0;
for(k=0; k<2; k++){
temp.a[i][j] += a[i][k] * c.a[k][j];
}
}
}
return temp;
}
};
使用後
class Matrix{//行列計算用のクラス
private:
complex<double> a[2][2];
public:
void Set(int i,int j, complex<double> k)
{
a[i][j] = k;
}
complex<double> Get(int i,int j)
{
return a[i][j];
}
Matrix operator*(Matrix& c)
{
Matrix temp;
int i,j,k;
for(i=0; i<2; i++){
for(j=0; j<2; j++){
temp.a[i][j] =0;
for(k=0; k<2; k++){
temp.a[i][j] += a[i][k] * c.a[k][j];
}
}
}
return temp;
}
};
違いは一目瞭然ですね。 「SyntaxHighlighter」のインストール方法、設定方法は「NetyaSun 社」にて紹介されています。



