lua 之 三木运算符

时间:2014-02-27 13:06:23   收藏:0   阅读:463

在c语言中我三目运算符这么写: a?b:c

例如:

max = a>b?a:b;

在lua中我们这么写

max = a>b and a or b

运行如下:

bubuko.com,布布扣

lua 之 三木运算符,布布扣,bubuko.com

原文:http://www.cnblogs.com/dzqdzq/p/3569629.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!