首页 > 其他 > 详细

快速读模板

时间:2018-09-24 10:15:02      阅读:141      评论:0      收藏:0      [点我收藏+]

不能与其它输入流混用

技术分享图片
 1 inline char getChar() {
 2     static char str[300000];
 3     static int head = 0, tail = 0;
 4     if (head == tail) {
 5         tail = fread(str, 1, 300000, stdin);
 6         head = 0;
 7     }
 8     return str[head++];
 9 }
10 inline int get_int() {
11     int res = 0; char c = getChar();
12     while (!isdigit(c)) c = getChar();
13     while (isdigit(c)) res = res * 10 + c - 0, c = getChar();
14     return res;
15 }
View Code

 

快速读模板

原文:https://www.cnblogs.com/BIGTOM/p/9694572.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!