zoukankan      html  css  js  c++  java
  • __int128 输入输出模板

    #include <bits/stdc++.h>
    using namespace std;
    
    void scan(__int128 &x)//输入
    {
        x = 0;
        int f = 1;
        char ch;
        if((ch = getchar()) == '-') f = -f;
        else x = x*10 + ch-'0';
        while((ch = getchar()) >= '0' && ch <= '9')
            x = x*10 + ch-'0';
        x *= f;
    }
    
    void print(__int128 x)//输出
    {
        if(x < 0)
        {
            x = -x;
            putchar('-');
        }
         if(x > 9) print(x/10);
        putchar(x%10 + '0');
    }
    
    int main()
    {
        __int128 a, b;
        scan(a); scan(b);
        print(a + b);
        puts("");
        print(a*b);
        return 0;
    }
  • 相关阅读:
    算法70----只有两个键的键盘【动态规划】
    Shell
    Shell
    Shell
    Shell
    Shell
    Tools
    Jenkins
    Java
    Product
  • 原文地址:https://www.cnblogs.com/TQCAI/p/8458047.html
Copyright © 2011-2022 走看看