相关疑难解决方法(0)

快速输入输出功能

#define getcx getchar_unlocked
inline void inp( int &n )//fast input function
{
   n=0;
   int ch=getcx();int sign=1;
   while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getcx();}

   while(  ch >= '0' && ch <= '9' )
           n = (n<<3)+(n<<1) + ch-'0', ch=getcx();
   n=n*sign;
}
Run Code Online (Sandbox Code Playgroud)

嗨我一直在各种编码竞赛中使用上述功能输入,但从来没有能够理解为什么它很快.我知道逻辑,但不知道它的坚牢度的概念.例如,这行是做什么的"#define getcx getchar_unlocked".另外我不知道任何快速输出功能,所以还有任何快速输出功能

c c++ operating-system coding-style

5
推荐指数
1
解决办法
7261
查看次数

标签 统计

c ×1

c++ ×1

coding-style ×1

operating-system ×1