C++ 三元运算符与if语句等价实现 - 实例详解
if(x >= y){ z = x; } else { z = y; }
上机实验代码:(C++)
#include
int main(){ int x, y, z; cout << '请输入x和y的值:' << endl; cin >> x >> y; if(x >= y){ z = x; } else { z = y; } cout << 'z的值为:' << z << endl; return 0; }
原文地址: https://www.cveoy.top/t/topic/l0nV 著作权归作者所有。请勿转载和采集!