萌新CE求调
查看原帖
萌新CE求调
531319
thomaswmy楼主2024/3/2 15:21
#include <bits/stdc++.h>
using namespace std;

__int128 read() {
    __int128 s=0;
    char c=getchar();
    bool f=0;
    while(c<'0' || c>'9') f|=c=='-',c=getchar();
    while(c>='0' && c<='9') s=s*10+c-'0',c=getchar();
    s=abs(s);
    return f? -s:s;
}

void write(__int128 x) {
    char buf[50];
    int tot=0;
    if(x<0) putchar('-'),x*=-1;
    while(x) {
        buf[++tot]=x%10+'0';
        x/=10;
    }
    if(!tot) buf[++tot]='0';
    while(tot) putchar(buf[tot--]);
}

int main() {
    write(read()+read());
	return 0;
}
2024/3/2 15:21
加载中...