我了解到使用getchar_unlocked是快速读取输入的方法.我看过许多地方的代码,但无法理解.任何人都可以帮我理解如何阅读使用getchar_unlocked?提前致谢.
void scanint(int &x)
{
register int c = getchar_unlocked();
x = 0;
for(;(c<48 || c>57);c = getchar_unlocked())
;
for(;c>47 && c<58;c = getchar_unlocked())
{
x = (x<<1) + (x<<3) + c - 48;
}
}
Run Code Online (Sandbox Code Playgroud)
我也看过很多其他代码.我不太明白改变号码的目的.对此有任何帮助表示赞赏
sqrt()和pow()函数math.h库中C没有为定义integer的类型,但他们不抛出任何错误,但对于正常工作integer参数,如何工作的呢?