就是for循环中的变量,也就是你的 i 和 j,也要指明类型,你这里应该是int类型的吧
另外你的a,按你这里的应该是个数组,可是在main中也没有声明
public class Extreme {
public static void main(String[] args) {
int a[] = { 5, 8, 7, 4, 6, 1, 3, 2, 0, 9 };
int temp;
for (int i = 0; i < 9; i++) {
temp = a[i];
for (int j = i + 1; j < 9; j++) {
if (a[i] > a[j]) {
temp = a[j];
a[j] = a[i];
a[i] = temp;
}
}
}
}
}
具体的逻辑我就没看了,不知道你要实现声明逻辑