特殊数据类型

long double

double 占8字节,long double 占12字节

long double a;
scanf("%LF",&a);
a=sqrtl(a);
printf("%.10LF",a);

常用函数都要在末尾加个 “l”, 如fabsl(a) , sqrtl(a) , cosl(a)

unsigned long long

long long最大为\(2^{63}-1\)=9.2e18​

unsigned long long 最大为\(2^{64}-1\)=1.8e19

//最大为2^64-1
ull a;
scanf("%llu",&a);
printf("%llu\n",a);

__int128

最大为\(2^{127}-1\)=1.7e38

inline __int128 read(){
    __int128 x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}

inline void print(__int128 x){
    if(x<0){
        putchar('-');
        x=-x;
    }
    if(x>9)
        print(x/10);
    putchar(x%10+'0');
}
posted @ 2020-12-16 17:39  UCPRER  阅读(131)  评论(0编辑  收藏  举报