当前位置: 编程技术>java/j2ee
JAVA简单分组的算法实现
来源: 互联网 发布时间:2014-10-22
本文导语: 代码如下:import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * Created with IntelliJ IDEA. * User: dell * Date: 13-3-5 * Time: 下午8:38 * To change this template use File | Settings | File Templates. */ public class Group { pu...
代码如下:
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: dell
* Date: 13-3-5
* Time: 下午8:38
* To change this template use File | Settings | File Templates.
*/
public class Group {
public static void main(String[] args)
{
int[] i ={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18};
int len = i.length;
int count = len/5;
//够4000的一组处理
for(int j = 0 ; j < count ; j++)
{
for(int m = 0 ; m