#1226. (板子)快读

(板子)快读

题目描述

输入 2×1062 \times 10^6 个值域在 1×1091 \times 10^9 ~ 2×1092 \times 10^9 之间的整数,输出它们。

你可以分别使用 cin/cout , scanf()/printf(), 关闭同步的 cin/cout ,自己的快读快写板子分别测试。

输入输出格式

输入格式

2×1062 \times 10^6 行。每行一个值域在 1×1091 \times 10^9 ~ 2×1092 \times 10^9 之间的整数。

输出格式

2×1062 \times 10^6 行。每行一个输入的整数。

输入输出样例

预设模板

#include <cstdio>
#include <iostream>

const int SIZE = 1 << 16;

inline __attribute__((always_inline)) char Getchar()
{
    static char buf[SIZE];
    static char *begin = buf, *end = buf;
    if (begin == end)
    {
        end = buf + fread(buf, 1, SIZE, stdin);
        begin = buf;
        if (begin == end) return EOF;
    }
    return *begin++;
}

inline __attribute__((always_inline)) int readInt() 
{
    int x = 0, sgn = 1;
    char c = Getchar();
    while ((c < '0' || c > '9') && c != '-' && c != EOF) c = Getchar();
    if (c == '-') { sgn = -1; c = Getchar(); }
    while (c >= '0' && c <= '9') 
    {
        x = x * 10 + (c - '0');
        c = Getchar();
    }
    return x * sgn;
}

void writeInt(int x) 
{
    if (x < 0) 
    {
        putchar('-');
        x = -x;
    }
    char buf[10];
    int len = 0;
    do 
    {
        buf[len++] = x % 10 + '0';
        x /= 10;
    } while (x);
    while (len) putchar(buf[--len]);
}