import java.util.ArrayList;
import java.util.List;
public class Mode {
public static void main(String[] args) {
List<Integer> Data0 = new ArrayList<Integer>();
List<Integer> Data1 = new ArrayList<Integer>();
for (int i = 0; i < 100; i++) {
if(i%2 != 0) {
Data0.add(i);
}else {
Data1.add(i);
}
}
System.out.println("奇数有:"+Data0.toString());
System.out.println("偶数有:"+Data1.toString());
}
}
温馨提示:内容为网友见解,仅供参考