/**
* @ClassName main 测试类
* @Description TODO
* @Author XPL
* @Date 2022/2/6 23:43
* @Version 1.0
*/
public class main {
public static void main(String[] args) {
Integer[] arry = new Integer[] {3,0,0,1,2};
int count = 0;
int temp = 0;
for (int i = 0; i < arry.length - 1; i++) {
temp = arry[i];
for (int j = i + 1; j < arry.length; j++) {
if (temp == arry[j]) {
count++;
System.out.println("第" + (i + 1) + "个跟第" + (j + 1) + "个重复,值是:" + temp);
}
}
}
if (count == 0) {
System.out.println("并无重复数值!");
}else {
System.out.println("存在重复数值!");
}
}
}