当前位置:网站首页>读入、输出优化
读入、输出优化
2022-08-02 07:20:00 【*﹏ℳ๓无情*】
关闭同步
ios::sync_with_stdio(false), cin.tie(0);
//cin和cout 不能和其他的scanf,printf,puts,sscanf,sprintf,getchar等混用
整形
读入
template <typename T> inline T read()
{
T sum = 0, fl = 1;
int ch = getchar();
for (; !isdigit(ch); ch = getchar())
if (ch == '-')
fl = -1;
for (; isdigit(ch); ch = getchar())
sum = sum * 10 + ch - '0';
return sum * fl;
}
//a=read<int>();
输出
template <typename T> inline void write(T x)
{
if (x < 0)
putchar('-'), x *= -1;
if (x > 9)
write(x / 10);
putchar(x % 10 | '0');
}
//write(a);
边栏推荐
- OC-NSArray
- flutter解决键盘和输入框不适配问题
- spark架构
- CollectionUtil:一个函数式风格的集合工具
- Enterprise training and reproduction guidebook - training and reasoning of the OpenPose model based on Huawei ModelArts platform, realizing the recognition of two behaviors of climbing and climbing ov
- PLSQL Developer安装和配置
- 【Network】IP, subnet mask
- 静态路由综合实验
- spark read folder data
- OC-Category
猜你喜欢

redis-advanced

机器学习笔记--数学库

Splunk Filed Alias 字段改名
![[Unity3D] Beginner Encryption Skills (Anti-Cracking)](/img/07/4a0731dd66b058c07d6240ffd36eea.png)
[Unity3D] Beginner Encryption Skills (Anti-Cracking)

DeadLock的可视化分析
![The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]](/img/14/cd6ed7452230571db2e027f61dbdba.png)
The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]

PanGu-Coder:函数级的代码生成模型

如何保护智能家居不受黑客攻击

Splunk Field Caculated 计算字段

Install Metasploitable2 on VMware
随机推荐
FormData upload binary file, object, object array
有点奇怪!访问目的网址,主机能容器却不行
论文理解:“Cross-Scale Residual Network: A GeneralFramework for Image Super-Resolution,Denoising, and “
Introduction to mysql operation (4) ----- data sorting (ascending, descending, multi-field sorting)
OC - NSSet (set)
关于DDoS的几个误区
敏捷、DevOps和嵌入式系统测试
LeetCode刷题(7)
LeetCode 2360. 图中的最长环
Chain Of Responsibility
CSRF-Cross-site request forgery-related knowledge
PLSQL Developer安装和配置
Appium swipe problem
HCIP 第十一天
spark read local file
CollectionUtil:一个函数式风格的集合工具
View port number occupancy
Neural network
OC-error prompt
ROS文件系统以及相关命令