Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. scan = new Scanner(new BufferedReader(new FileReader("input.txt")));
  2. int n = scan.nextInt();
  3. for (int i = 0; i < n; i++) {
  4. while (scan.hasNextLine()) {
  5. sum += scan.nextInt();
  6. }
  7. System.out.println(sum);
  8. sum = 0;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement