计算-10.8到6之间的绝对值大于6或者小于2.1的数
package test;
public class main {
public static void main(String[] args) {
double min = -10.8;
double max = 6;
for (int i = (int) -10.8; i < (int) 6; i++) {
if (i < 0) {
i = -i;
if (i > 6 || i < 2.1) {
i=-i;
System.out.println(i);
}else{
i=-i;
}
} else {
if (i > 6 || i < 2.1) {
System.out.println(i);
}
}
}
}
}