今天学习了逻辑运算符的短路效果,三元运算符,逗号运算符
int main()
{
int a = 10;
int b = 20;
int c = 30;
int temp = a > b ? a : b;//a > b ? b : a若是写成这样,则实际上求的是最小值
int max = temp > c ? temp : c;
printf("%d", max);
return 0;
}
今天学习了逻辑运算符的短路效果,三元运算符,逗号运算符
int main()
{
int a = 10;
int b = 20;
int c = 30;
int temp = a > b ? a : b;//a > b ? b : a若是写成这样,则实际上求的是最小值
int max = temp > c ? temp : c;
printf("%d", max);
return 0;
}