yuesefu Posted on 2020-03-30 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748package com.test.dobleNumSum;import javax.naming.InitialContext;public class test11 { //Լɪ������ static int a []=new int[20]; static boolean b[]=new boolean[20]; static int num=1; static void init(int a[],int num){ for(int i=0;i<a.length;i++){ a[i]=i+1; } int i=0; while(true){ if(i==a.length-1){ i=-1; }else{ i++; if(b[i]==true){ continue; }else{ ++num; if(num==3){ num=0; b[i]=true; System.out.print(a[i]+" && "); } } } } } public static void main(String[] args) { init(a, num); }}