标签:加速 code oid put div pre amp char turn
下面这段代码在输入时会加速?
1 template<class T> void read(T&num) { 2 char CH; bool F=false; 3 for(CH=getchar();CH<‘0‘||CH>‘9‘;F= CH==‘-‘,CH=getchar()); 4 for(num=0;CH>=‘0‘&&CH<=‘9‘;num=num*10+CH-‘0‘,CH=getchar()); 5 F && (num=-num); 6 } 7 int stk[70], tp; 8 template<class T> inline void print(T p) { 9 if(!p) { puts("0"); return; } 10 while(p) stk[++ tp] = p%10, p/=10; 11 while(tp) putchar(stk[tp--] + ‘0‘); 12 putchar(‘\n‘); 13 }
标签:加速 code oid put div pre amp char turn
原文地址:http://www.cnblogs.com/bofengyu/p/6753421.html