提交记录 16997


用户 题目 状态 得分 用时 内存 语言 代码长度
gvihvo 1000i. 【传统题】 A+B Problem Accepted 100 23.33 us 12 KB C++ 782 B
提交时间 评测时间
2021-11-26 16:38:08 2021-11-26 16:38:10
#include <cstdio>
#include <cctype>

const int N = 30;

int top, stk[N];

void read(int &x) {
    x = 0;
    bool f = false;
    char ch = getchar();
    while(!isdigit(ch)) {
        if(ch == '-')
            f = true;
        ch = getchar();
    }
    while(isdigit(ch)) {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    if(f)
        x = -x;
}

void write(int x) {
    bool f = false;
    if(x < 0) {
        x = -x;
        f = true;
    }
    do {
        stk[++top] = x % 10;
        x /= 10;
    } while(x);
    if(f)
        putchar('-');
    while(top)
        putchar(stk[top--] + '0');
    putchar('\n');
}

int main() {
    int n;
    read(n);
    for(int i = 1, a, b; i <= n; ++i) {
        read(a), read(b);
        write(a + b);
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #123.33 us12 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-05-04 11:21:08 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用