Competitive Programmer’s Handbook 笔记


命令行编译:

g++ -std=c++11 -O2 -Wall test.cpp -o test

This command produces a binary file test from the source code test.cpp. The

compiler follows the C++11 standard (-std=c++11), optimizes the code (-O2) and

shows warnings about possible errors (-Wall)


#include<bits/stdc++.h>
using namespace std;

int main()
{
    cout<<INT_MAX<<"\n";
    cout<<LONG_LONG_MAX<<"\n";
    int a = 123456789;
    long long b = a*a;
    cout << b << "\n"; // -1757895751

    b=1LL*a*a;
    cout << b << "\n";

    double x = 0.3*3+0.1;
    printf("%.20f\n", x); // 0.99999999999999988898
    return 0;
}




int  10的9次方,   long long 18次方

long long x = 123456789123456789LL;

posted @ 2025-04-14 17:00  katago  阅读(4)  评论(0)    收藏  举报