标签:style blog color ar div amp log line
读入优化:
inline int read() { char ch; bool flag = false; int a = 0; while(!((((ch = getchar()) >= ‘0‘) && (ch <= ‘9‘)) || (ch == ‘-‘))); if(ch != ‘-‘) { a *= 10; a += ch - ‘0‘; } else { flag = true; } while(((ch = getchar()) >= ‘0‘) && (ch <= ‘9‘)) { a *= 10; a += ch - ‘0‘; } if(flag) { a = -a; } return a; }
输出优化:
void write(int a) { if(a < 0) { putchar(‘-‘); a = -a; } if(a >= 10) { write(a / 10); } putchar(a % 10 + ‘0‘); putchar(‘\n‘); }
标签:style blog color ar div amp log line
原文地址:http://www.cnblogs.com/kevince/p/3924688.html