%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