ACM C++快读快写一体模板

比赛时自己用的,方便

#include<bits/stdc++.h>
#define mem(x) memset(x,0,sizeof(x))
using namespace std;
typedef long long ll;
const ll maxn=1e5+10;
const ll mod=1e9+7;
const ll inf=0x7f7f7f7f;
template<typename T>void read(T &x)
{
    x = 0;char ch = getchar();ll f = 1;
    while(!isdigit(ch)){if(ch == '-')f*=-1;ch=getchar();}
    while(isdigit(ch)){x = x*10+ch-48;ch=getchar();}x*=f;
}
template<typename T>void write(T x)
{
    if(x<0)
    {
        putchar('-');
        x=-x;
    }
    if(x>9)
    {
        write(x/10);
    }
    putchar(x%10+'0');
}
ll T;
bool flag;
int main()
{
    read(T);
    while(T--)
    {
    }
    return 0;
}

发布了43 篇原创文章 · 获赞 10 · 访问量 5548

猜你喜欢

转载自blog.csdn.net/STL_CC/article/details/105596003