[关闭]
@Dmaxiya 2017-12-13T21:57:19.000000Z 字数 296 阅读 962

读入挂

板子


  1. const int SIZE = 100000;
  2. // SIZE 为读入数据长度,单位为字节
  3. inline char nc() {
  4. static char buf[SIZE], *p1 = buf, *p2 = buf;
  5. return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, SIZE, stdin), p1 == p2)? EOF: *p1++;
  6. }
  7. inline int _read() {
  8. char ch = nc();
  9. int sum = 0;
  10. while(!(ch >= '0' && ch <= '9')) ch = nc();
  11. while(ch >= '0' && ch <= '9') sum = sum * 10 + ch - 48, ch = nc();
  12. return sum;
  13. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注