数字输入输出优化

xiaoxiao2021-02-28  108

在比赛中,凡是要有数字输入输出的题目,通通要用数字输入输出优化!!!

inline int read(){ bool f=0;int x=0;char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')f^=1;ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();} return f?-x:x; } inline void write(int x){ if(x<0)x=-x,putchar('-'); if(x>9)write(x/10); putchar(x+48); }
转载请注明原文地址: https://www.6miu.com/read-42940.html

最新回复(0)