__int128

void scan(__int128 &x)
{
    x = 0;
    int f = 1;
    char ch;
    if((ch = getchar()) == '-') f = -f;
    else x = x*10 + ch-'0';
    while((ch = getchar()) >= '0' && ch <= '9')
        x = x*10 + ch-'0';
    x *= f;
}

void print(__int128 x){
    if(x < 0){
        x = -x;
        putchar('-');
    }
    if(x > 9) print(x/10);
    putchar(x%10 + '0');
}

//More case
inline __int128 read(char *S){
    __int128 X = 0;int i=0;
    int flag=1;
    if(S[0]=='-'){
        i++;flag=-1;
    }
    while(S[i]>='0'&&S[i]<='9') X=X*10+S[i]-'0',++i;
    return X*flag;
}
char str[maxn];
while(~scanf("%s",str){
    __int128 a = read(str);
}

 

你可能感兴趣的:(模板自用)