mainintm=5;ifm++5printfdnm;elseprintfdnm--;怎样做
这段代码有语法错误,应该修改为:
int main() { int m = 5; if (m++ > 5) { printf("%d\n", m); } else { printf("%d\n", m--); } return 0; }
这段代码的输出结果为5,因为m的初值为5,if语句中m++并不大于5,所以输出m的值为5,然后m--使m的值变为了4。
原文地址: https://www.cveoy.top/t/topic/XTK 著作权归作者所有。请勿转载和采集!