importjava.lang.*;importjava.util.Scanner;importjava.io.*;publicclassTesttextendsTes{publicstaticvoidmain(String[]args){intnumber=0;Scannersc=newScanner(System.in);System...
import java.lang.*;
import java.util.Scanner;
import java.io.*;
public class Testt extends Tes{
public static void main(String[]args){
int number=0;
Scanner sc =new Scanner(System.in);
System.out.println("请输入您的成绩:");
number = sc.nextInt();
if(number<100&&number>90){
System.out.println("您的成绩为:优秀");}
if(number<89&&number>80){
System.out.println("您的成绩为:良好");}
if(number<79&&number>70){
System.out.println("您的成绩为:中等");}
if(number<69&&number>60){
System.out.println("您的成绩为:及格");}
if(number<59&&number>0){
System.out.println("您的成绩为:不及格");}
}
}
怎么把这里的成绩输入到数组里去?
public class Testt {
public Testt(){}
public static void main(String[]args){
System.out.println("This is Testt");
float a =0.0f ;//总分
float b =0.0f ;//平均分
int c[]=new int[]{87,96,83,86,90,84,78,93,72,84};
System.out.println("成绩好的:");
for(int d=0;d
if(c[d]>=90)
System.out.println("学号:"+d+"成绩:"+c[d]);
}
int sum=0;
for(int e=0;e
//计算总分
sum = sum+c[e];
System.out.println("总分是:"+c[e]);
//计算平均分
double average=sum/c.length;
System.out.println("平均分是:"+average);
System.out.println("good");
}
}
}
然后数组在计算平均分?
怎么编写到一个类里去????
展开