(String[] args)
| 7 | |
| 8 | public class sumcol { |
| 9 | public static void main(String[] args) { |
| 10 | int sum = 0; |
| 11 | String line; |
| 12 | try { |
| 13 | BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); |
| 14 | while ((line = in.readLine()) != null) { |
| 15 | sum = sum + Integer.parseInt(line); |
| 16 | } |
| 17 | } catch (IOException e) { |
| 18 | System.err.println(e); |
| 19 | return; |
| 20 | } |
| 21 | System.out.println(Integer.toString(sum)); |
| 22 | } |
| 23 | } |