Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class SumDouble {
  2.     public static void main(String[] args) {
  3.         double sum = 0;
  4.         for (String arg : args) {
  5.             for (String token : arg.split("\\p{javaWhitespace}")) {
  6.                 if (!token.isBlank()) {
  7.                     sum += Double.parseDouble(token);
  8.                 }
  9.             }
  10.         }
  11.         System.out.println(sum);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement