fread了解一下
2024-08-30 06:49:48
神奇读入挂_
记得加头文件#include
const int BufferSize=100*1000;
char buffer[BufferSize],*head,*tail;
bool not_EOF=true;
inline char Getchar(){
if(not_EOF and head==tail){
int len=fread(buffer,1,BufferSize,stdin);
not_EOF=len!=0;
head=buffer,tail=head+len;
}
return not_EOF?*head++:-1;
}
inline int rd(){
int x=0,s=1;
char c=Getchar();
for(;!isdigit(c) and not_EOF;c=Getchar()) if(c=='-') s=-1;
for(; isdigit(c) and not_EOF;c=Getchar()) x=(x<<1)+(x<<3)+(c^48);
return s*x;
}
inline void scan(char *str){
char c=Getchar();
for(; isspace(c) and not_EOF;c=Getchar());
for(;!isspace(c) and not_EOF;c=Getchar()) *(str++)=c;
*str=0;
}
最新文章
- [原创开源项目]EPUBBuilder一款在线的epub电子书编辑工具
- lua 类支持属性不能被修改
- Office 365 - SharePoint 2013 Online 中创建母版页
- 【POJ 3041】Asteroids (最小点覆盖)
- VB中的属性、方法和事件概念解析
- 【POJ】2954 Triangle(pick定理)
- Show Users Assigned to a Specific Role
- 1050 数的计数 c语言实现
- ajax withCredentials在firefox下问题的解释
- redis+PHP实现的一个优先级去重队列
- C# TypeConverter 数据转换
- 自己改写了一个图片局部放大的jquery插件页面里面的html代码少了,同一个页面可以调用多个
- Linux MySQL5.5源码安装
- 从壹开始前后端分离【 .NET Core2.0 +Vue2.0 】框架之十二 || 三种跨域方式比较,DTOs(数据传输对象)初探
- Python+Tkinter 实现计算器功能
- MySQL使用select查询时,在查询结果中增加一个字段并指定固定值
- 01:golang开发环境
- 使用MyBatis Generator 1.3.7自动生成代码
- 解决SecureCRT超时自动断开的问题
- 【Java并发编程】之十六:深入Java内存模型——happen-before规则及其对DCL的分析(含代码)