You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
565 B
18 lines
565 B
|
|
import java.io.BufferedReader;
|
|
import java.io.FileReader;
|
|
|
|
public class Scorecal {
|
|
public static void main(String[] args) throws Exception {
|
|
BufferedReader br = new BufferedReader(new FileReader("C:\\Users\\黄志楷\\Documents\\ocix\\学校相关\\jwork\\w7\\score"));
|
|
String line;
|
|
int sum = 0;
|
|
int count = 0;
|
|
while ((line = br.readLine()) != null) {
|
|
sum += Integer.parseInt(line);
|
|
count++;
|
|
}
|
|
br.close();
|
|
System.out.println((double) sum / count);
|
|
}
|
|
}
|