首页 > 其他 > 详细

个人码风

时间:2018-08-27 11:57:28      阅读:149      评论:0      收藏:0      [点我收藏+]

大括号不换行

int f(int x){
    ...
}

运算符之间打空格

if(a + b > c && d - e <= f)

逗号后打空格

int a, b, c;

函数缩进4格,for缩进3格,if,else,while,switch缩进2格

int f(x){
    for(int i = 1; i <= n; ++i)
       if(i % 2 == 0)
         while(i % 2 == 0)
           i /= 2;
    return 233;
}

喜欢用#define

#define lowbit(x) (x & (-x))
#define INF 2147483647
#define ll long long
#define left (now << 1)
#define right (now << 1 | 1)
#define Open(s) freopen(s".in","r",stdin);freopen(s".out","w",stdout);
#define Close fclose(stdin); fclose(stdout);

常量名全大写

const int MAXN = 100010;

个人码风

原文:https://www.cnblogs.com/Qihoo360/p/9541331.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!