输入输出优化代码
来源:互联网 发布:美工怎么上传 编辑:程序博客网 时间:2024/05/16 14:04
#include <cctype>
inline int readint()
{
char c = getchar();
int x = 0;
while(!isdigit(c))
c = getchar();
while(isdigit(c))
{
x = x * 10 + c - '0';
c = getchar();
}
return x;
}
int buf[10];
inline void writeint(int i)
{
int p = 0;
if(!i)
p++;
else while(i)
{
buf[p++] = i % 10;
i /= 10;
}
for(int j = p-1; j >= 0; j--)
putchar('0' + buf[j]);
inline int readint()
{
char c = getchar();
int x = 0;
while(!isdigit(c))
c = getchar();
while(isdigit(c))
{
x = x * 10 + c - '0';
c = getchar();
}
return x;
}
int buf[10];
inline void writeint(int i)
{
int p = 0;
if(!i)
p++;
else while(i)
{
buf[p++] = i % 10;
i /= 10;
}
for(int j = p-1; j >= 0; j--)
putchar('0' + buf[j]);
}
以上代码只能处理非负整数
0 0
- 输入输出优化代码
- 输入输出优化
- ACM_java输入输出优化
- c语言输入输出优化
- 输入输出优化模板
- 输入输出优化(来自LG)
- 【考试技巧】输入输出优化
- 数字输入输出优化
- NOIP输入输出优化
- c++ 输入输出优化
- java输入输出代码片段
- ACM之java 输入输出优化
- ACM中Java输入输出优化
- python基本输入输出代码示例
- Java输入输出重定向代码
- Java输入输出流代码示例
- java输入输出流实例代码
- cin cout 快速输入输出(效率优化)
- oracle查看写法效率
- CentOS Oracle数据库每天自动备份
- oracle 游标实例
- Windows API ——CreateMutex——创建互斥对象
- USB之(一)概述
- 输入输出优化代码
- ubuntu14.04 +nginx+php5-fpm
- iOS集成支付宝
- Rank List
- android oom
- leetcode-39/40 Combination Sum / II
- Hololens开发,Unity不是必选的,但当下是唯一的
- HDU1823-二维线段树
- HDU5387 Clock 时钟模拟