当前位置: 移动技术网 > 移动技术>移动开发>Android > Code::Blocks 自定义代码模板(刷题专用)

Code::Blocks 自定义代码模板(刷题专用)

2020年08月02日  | 移动技术网移动技术  | 我要评论

Code::Blocks 自定义代码模板(刷题专用)

前言:平常我们刷题都会自己打开一个文件重新手写头文件等等繁杂的东西,这样效率并不高,尤其在比赛的时候,当你写完的时候别人一个快捷键直接导入代码模板,那这样你就比别人少了很多时间,甚至别人已经AC了。然后下一题下下一题·······幸好你看到了这篇,我接下来手把手来教你怎么设置自己的代码模板,以及如何用快捷键导入

第一步:打开settings,进入Editor界面
在这里插入图片描述
第二步:滑至Abbreviations(我这里汉化是缩写词)界面,此时我们看到的就是系统自带的代码填写功能,比如if,我们在输入的时候按if再按Ctrl+J即可自动替换为if(true);
在这里插入图片描述
第三步:点击add添加关键字,也就是之后我们输入要替换的字
在这里插入图片描述
第四步:填充我们的代码模板,填充之后确定即可。
在这里插入图片描述
以上就是所有步骤了,我们在输入界面输入关键字再按Ctrl+J即可替换导入我们的代码模板了。

这是我的代码模板:

/*
*邮箱:2825841950@qq.com
*blog:https://blog.csdn.net/hzf0701
*注:代码如有问题请私信我或在评论区留言,谢谢支持。
*/ #include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #include<cmath> #include<string> #include<stack> #include<queue> #include<cstring> #include<map> #include<iterator> #include<list> #include<set> #include<functional> #include<memory.h>//低版本G++编译器不支持,若使用这种G++编译器此段应注释掉 #include<iomanip> #include<vector> #include<cstring> #define scd(n) scanf("%d",&n) #define scf(n) scanf("%f",&n) #define scc(n) scanf("%c",&n) #define scs(n) scanf("%s",n) #define prd(n) printf("%d",n) #define prf(n) printf("%f",n) #define prc(n) printf("%c",n) #define prs(n) printf("%s",n) #define rep(i,a,n) for (int i=a;i<=n;i++)//i为循环变量,a为初始值,n为界限值,递增 #define per(i,a,n) for (int i=a;i>=n;i--)//i为循环变量, a为初始值,n为界限值,递减。 #define pb push_back #define fi first #define se second #define mp make_pair using namespace std; const int inf = 0x3f3f3f3f;//无穷大 const int maxn = 1e5;//最大值。 typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; //*******************************分割线,以上为代码自定义代码模板***************************************// int main(){ //freopen("in.txt", "r", stdin);//提交的时候要注释掉 ios::sync_with_stdio(false);//打消iostream中输入输出缓存,节省时间。 cin.tie(0); cout.tie(0);//可以通过tie(0)(0表示NULL)来解除cin与cout的绑定,进一步加快执行效率。 return 0; } 

本文地址:https://blog.csdn.net/hzf0701/article/details/107714346

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网