Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Sum {
- public static void main(String[] args) {
- int result = 0;
- for (String currentString : args) {
- for (String currentDigit : currentString.split("[^0-9.-]")) {
- if (!currentDigit.isEmpty()) {
- result += Integer.parseInt(currentDigit);
- }
- }
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement