萌新CE求调

P1001 A+B Problem

thomaswmy @ 2024-03-02 15:21:28

#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;
}

by zifanwang @ 2024-03-02 15:23:07

@thomaswmy 需要手动定义 abs /lh


by huang_yi_hang2014 @ 2024-03-02 15:36:57

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin >> a >> b;
    cout << a+b;
    return 0; 
}

by Coffins @ 2024-03-02 15:38:25

草,紧跟时事


by chenyilai @ 2024-03-02 20:37:54

紧跟时逝


by SerenityWay @ 2024-03-13 19:27:50

第一次见到红名的萌新QwQ


by liuhuayang @ 2024-03-17 22:47:18

有必要弄这么复杂吗?


by Cute_QiQi @ 2024-03-21 14:38:29

#include<iostream>
main(){int a,b;std::cin>>a>>b;std::cout<<a+b;}

求关


by Zxx20120715 @ 2024-03-22 22:16:08

我表示很不李姐


|