java编译出现Exception in thread "main" java.lang.Error: Unresolved compilation problem: 30
importjava.util.Scanner;publicclassRank{staticintn;publicstaticvoidmain(String[]args)...
import java.util.Scanner;
public class Rank{
static int n;
public static void main (String[] args){
Scanner in=new Scanner(System.in);
n=in.nextInt();
int a[]=new int[100];
for(int i=0;i<n;i++){
a[i]=(int)(1+Math.random()*(1000)) ;
}
int b[]=new int[100];
for(int j=0;j<n-1;j++){
for(int k=j+1;k<n;k++){
int e=a[j];
if(a[j]>a[k]) {a[j]=a[k]; a[k]=e;k++;}
system.out.print(a[j]+" ");}}
}
}
点运行后显示这个:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
system cannot be resolved
at Rank.main(Rank.java:16) 展开
public class Rank{
static int n;
public static void main (String[] args){
Scanner in=new Scanner(System.in);
n=in.nextInt();
int a[]=new int[100];
for(int i=0;i<n;i++){
a[i]=(int)(1+Math.random()*(1000)) ;
}
int b[]=new int[100];
for(int j=0;j<n-1;j++){
for(int k=j+1;k<n;k++){
int e=a[j];
if(a[j]>a[k]) {a[j]=a[k]; a[k]=e;k++;}
system.out.print(a[j]+" ");}}
}
}
点运行后显示这个:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
system cannot be resolved
at Rank.main(Rank.java:16) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询