|
RGSS_2 发表于 2014-2-7 12:56 你这种写法连排序都算不上. 看看百科吧. http://baike.baidu.com/link?url= ... IJvq-0cEA3EOpUrk6Rt |
e = [rand(100), rand(100),rand(100)] p [e[0],e[1],e[2]] if e[0]>e[1] and e[0]>e[2] and e[1]>e[2] p [e[0],e[2],e[1]] if e[0]>e[1] and e[0]>e[2] and e[2]>e[1] p [e[1],e[0],e[2]] if e[1]>e[0] and e[1]>e[2] and e[0]>e[2] p [e[1],e[2],e[0]] if e[1]>e[0] and e[1]>e[2] and e[2]>e[0] p [e[2],e[0],e[1]] if e[2]>e[0] and e[2]>e[1] and e[0]>e[1] p [e[2],e[1],e[0]] if e[2]>e[0] and e[2]>e[1] and e[1]>e[0] 这样应该比刚刚简单多。 |
参与人数 1 | 星屑 -10 | 收起 理由 |
---|---|---|
![]() | -10 | 禁止连贴 |
|
如果你想获取的是一串数字里最大或者最小的那个, 也可以用默认的方法来解决.
|
方法可以返回3个参数的,就是一个数组。 |
我刚学,不怎么会额。 |
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2025-6-14 08:26
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.