TMS320F28035-EP通信与PWM模块实战:SCI、LIN、CAN、I2C、ePWM避坑指南
2026/7/15 19:22:27
如果你用 C++11 及以上(绝大多数 OJ / 编译器都支持):
cpp
运行
ios::sync_with_stdio(false); cin.tie(nullptr);理由:false和nullptr是 C++ 的 “语义化写法”,可读性最好,nullptr避免了NULL的类型歧义。
兼容旧版 C++(C++11 之前):
cpp
运行
ios::sync_with_stdio(0); cin.tie(0);理由:旧编译器可能不支持nullptr,用0最通用(洛谷、牛客等 OJ 的代码模板常用这种写法)。
要记得加
#define endl '\n'因为endl会开启同步流