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
493 B
18 lines
493 B
package java01;
|
|
|
|
// 加上这三行!
|
|
import java.io.BufferedReader;
|
|
import java.io.FileReader;
|
|
import java.io.IOException;
|
|
|
|
public class AverageScoreBefore {
|
|
public static void main(String[] args) throws Exception {
|
|
int sum = 0;
|
|
BufferedReader br = new BufferedReader(new FileReader("scores.txt"));
|
|
String line;
|
|
while ((line = br.readLine()) != null) {
|
|
sum += Integer.parseInt(line);
|
|
br.close();
|
|
}
|
|
}
|
|
}
|