128快读写挂了,求助
查看原帖
128快读写挂了,求助
1059049
Bramble_Marshall楼主2024/8/5 11:21
#include <iostream>
#include <stack>

using namespace std;

__int128 a, o;  // |A|<|O|

void scanf(__int128& tmp) {
    tmp = 0;
    char c = getchar();
    while (c < '0' || c > '9') c = getchar();
    while (c >= '0' && c <= '9')
        tmp += c - '0',
        tmp *= 10,
        c = getchar();
    tmp /= 10;
}

void printf(__int128 tmp) {
    stack<char> num;
    while (tmp > 1) {
        num.push(tmp % 10 + '0');
        tmp /= 10;
    } while (!num.empty()) {
        putchar(num.top());
        num.pop();
    }
}

int main() {
    scanf(o);
    printf(o);
    a = o * 2 - 1;
    if (a < 0) a = 0;
    // printf(a);
    return 0;
}
2024/8/5 11:21
加载中...