fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static int C (String s)
  8. {
  9. return s
  10. .chars() // stream the characters
  11. .filter(x -> x < 128) // filter ASCII
  12. .sum(); // return the sum
  13. }
  14.  
  15. public static void main (String[] args) throws java.lang.Exception
  16. {
  17. System.out.println( "Hello World!" );
  18. System.out.println( C("Hello World!") );
  19. }
  20. }
Success #stdin #stdout 0.23s 320704KB
stdin
Standard input is empty
stdout
Hello World!
1085