zoukankan      html  css  js  c++  java
  • 个人码风

    大括号不换行

    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;
    
  • 相关阅读:
    JAVA面向对象概述
    练习
    字符串
    图形代码
    assets转到内外部存储
    file存储
    sp存储
    Intent练习
    存储登录
    存储
  • 原文地址:https://www.cnblogs.com/Qihoo360/p/9541331.html
Copyright © 2011-2022 走看看