%lld 和 %I64d


在Linux下輸出long long 類型的是 

printf("%lld", a);

在Windows下輸出是

printf("%I64d", a);

xxy學姐:"如果不知道測評機是啥的咋辦?”

“像這樣!!”

#ifdef Linux
#define LL "%lld"
#else 
#define LL "%I64d"
#endif

這么重要的東西當然要貼在博客里!

 stO  wxyww Orz(那么認真的給我講題, 表示灰常感謝)

 %%%

eg:

#include <cstdio>
#include <iostream>
#ifdef Linux
#define LL "%lld"
#else 
#define LL "%I64d"
#endif
using namespace std;
int main() {
    long long a;
    cin >> a;
    printf(LL, a);
    return 0;
}

艹!我以后要是再寫錯這個玩意兒,我就請yxy吃飯!艹


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM