在CodeBlocks中
Setting->Editor->Abbreviations
左侧可以编辑代码目标
编辑好输入缩写然后按Ctrl + J生成
或者直接按Ctrl + J选择
可用用管道符 | 来定位光标 只能有一个 第二个会被识别为 |
下面附上使用的代码模板
tp
新建代码阶段使用的模板,加入函数p用以打印数组和变量
使用了函数模板和函数重载技术
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
template<typename T>
void p(T *a, int l)
{
for (int i = 0; i < l; i++) {
cout << a[i] << ' ';
}
cout << endl;
}
template<typename T>
void p(T x)
{
cout << x << endl;
}
void solve()
{
}
int main()
{
freopen("in.txt", "r", stdin);
|
}
fori
生成一个变量为i的For 结构
for (int i = 0; i < |; i++) {
}