1、报错的行多了if
2、arg × args √
改动后:
args =[11,19,21,29,31,39,40,50,60,70,80,90,100,100] if args.size == 14 a = [11,19,21,29,31,39] b = [40,50,60,70,80,90,100] c = a+b if c.all?{|i| i == args[c.index(i)]} if b.include?(args.last) return "xx" end end end
args =[11,19,21,29,31,39,40,50,60,70,80,90,100,100]
if args.size == 14
a = [11,19,21,29,31,39]
b = [40,50,60,70,80,90,100]
c = a+b
if c.all?{|i| i == args[c.index(i)]}
if b.include?(args.last)
return "xx"
end
end
end
|