Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.epam.rd.java.basic.practice1;
- public class Part2 {
- public static void main(String[] args) {
- int sum = 0;
- for (String numberStr : args) {
- try {
- int number = Integer.parseInt(numberStr);
- sum += number;
- } catch (NumberFormatException ignored) {
- }
- }
- System.out.println(sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment