投机取巧全WA求助
查看原帖
投机取巧全WA求助
306516
awathefox楼主2021/6/20 19:32
#include<iostream>
#include<algorithm>
using namespace std;
//读入
__uint128_t read(){
    __uint128_t x=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){//过滤
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){//读入
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x;
}
//写了个itoa
std::string u128titoa(__uint128_t a){
    __uint128_t n=a;
    std::string str(1000,'\0');
    size_t i=0;
    while (a>0){ 
        str[i++]=a%10+'0';//转换为字符
        a/=10;
    }
    std::reverse(str.begin(),str.end());
    return str;
}
int main(){
    __uint128_t a1,a2;
    a1=read();
    a2=read();
    cout<<u128titoa(a1*a2);
}

全部木大(悲)

2021/6/20 19:32
加载中...