![](http://hi.csdn.net/attachment/201203/5/0_13309116578osQ.gif)
方法很简单:
【1】、将CSDN的博客编辑功能中找到【源代码】即图标
![](http://hi.csdn.net/attachment/201203/5/0_1330912925R60t.gif)
【2】、在你要贴代码的前面加上如下一句话:
<textarea readonly="readonly" name="code" class="c++">
其中class为可以改成你自 己贴得语言类
#include<stdio.h>
#include "test1.h"
#include "test1.h" //多次包含也不会出错
int test2(void);
int main(void)
{
printf("main.c\n");
test1();
test2();
}
【3】、在代码结束的位置加上</textarea>
效果如下: