52

快学Scala 第三章 #4答案-12201918-51CTO博客

 6 years ago
source link: http://blog.51cto.com/12211918/2066692
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
4.给定一个整数数组,产生一个新的数组,包含原数组中的所有正值,按原有顺序排序之后的元素是所有的零或者负值,按原有顺序排序scala>valarr=Array(1,2,3,4,5,-1,6,0,-2,7,-3,8,-4,9,0,-5)arr:Array[Int]=Array(1,2,3,4,5,-1,6,0,-2,7,-3,8,-4,9,0,-5)scala>valap=arr.fil

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK