在Linux下输出long long 类型的是 

printf("%lld", a);

在Windows下输出是

printf("%I64d", a);

xxy学姐:"如果不知道测评机是啥的咋办?”

“像这样!!”

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

这么重要的东西当然要贴在博客里!

%lld 和 %I64d

 stO  wxyww Orz(那么认真的给我讲题, 表示灰常感谢)

%lld 和 %I64d

 %%%

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吃饭!艹

相关文章:

  • 2021-10-10
  • 2022-03-04
  • 2021-11-24
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2021-11-01
  • 2022-01-19
  • 2021-09-25
  • 2021-11-12
  • 2021-09-07
  • 2022-12-23
相关资源
相似解决方案