const int SIZE = 1 << 14;
char getc() {
static char buf[SIZE], *begin = buf, *end = buf;
if (begin == end) {
begin = buf;
end = buf + fread(buf, 1, SIZE, stdin);
}
return *begin++;
}
int read() {
int sgn = 0, ret = 0, ch = getc();
while (!isdigit(ch) && ch != EOF) ch |= ch == '-', ch = getc();
while (isdigit(ch) && ch != EOF) ret = ret * 10 + ch - '0', ch = getc();
return sgn ? -ret : ret;
}
void write(int x) {
if (x < 0) putchar('-'), x = -x;
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
return;
}
这段代码在
freopen("input.in", "r", stdin);
freopen("output.out", "w", stdout);
的条件(即文件输入输出)中能否运行正常?