求大佬

P1001 A+B Problem

ToryChef @ 2023-07-21 14:23:04

这道题怎么做啊,急


by all___right @ 2023-09-01 16:23:49

@miaomimmaomi

#include <iostream>

using namespace std;

typedef __int128_t int128;

int128 read(){
    int128 x=0;bool f=0;char c=getchar();
    while (c<'0'||c>'9'){if (c=='-')f=1;c=getchar();}
    while (c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}
    return f?-x:x;
}

inline void write(int128 x)
{
     if(x<0) putchar('-'),x=-x;
     if(x>9) write(x/10);
     putchar(x%10+'0');
}

int main(){
    int128 a = read();
    int128 b = read();
    write(a+b);
}

上一页 |