使用三元运算符返回三个变量中的最小值
我有三个变量,都是整数。
indexA
indexB
indexC
现在,使用三元运算符,如何返回三个值中的最小值?
I have three variables, all of the integers.
indexA
indexB
indexC
Now, using the ternary operator, how can I return the lowest value amongst the three?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下内容应该执行您想要的操作...
假设您可以使用其他运算符和方法,
The following
should do what you want, assuming you can use other operators and methods...
尝试
try
一定是三元运算符吗?使用
Min<>()
似乎更简单。Does it have to be the ternary operator? Using
Min<>()
seems simpler.