需要标识符?非法的类型开始?我快疯了
import java.util.Scanner;public class ScoreTest{
public static void main(String[] args){
Scanner reader=new Scanner(System.in);
double score[];
int n;
System.out.println("您要输入多少个学生的成绩");
n=reader.nextInt();
if(n<=0)
System.out.printfln("个数错误!");
else
score=new double[n];
for(int i=0;i<n;i++){
System.out.print("请输入第"+(i+1)"个童鞋的成绩:");
score[i]=reader.nextDouble();
}
Info.showInfo(n,score);
}
class Info{
public void showInfo(int n,double score[]){
Scanner reader=new Scanner(System.in);
System.out.println("您想查找第几个童鞋的成绩?");
int index=reader.nextInt();
if(index>0&&index<=n)
System.out.printfln("第"+index+"个童鞋的成绩是"+score[index+1]);
else
System.out.println("对不起,您输入的数字有误!");
}
}