fork download
  1. import java.util.stream.Collectors;
  2. import java.util.stream.IntStream;
  3.  
  4. class Stuff {
  5.  
  6.  
  7. public static void main(String[] args) {
  8. System.out.println(IntStream.rangeClosed(0, 100)
  9. .mapToObj(i -> i % 15 == 0 ? "tigh"
  10. : i % 5 == 0 ? "high"
  11. : i % 3 == 0 ? "tree"
  12. : String.valueOf(i))
  13. .collect(Collectors.joining(", ")));
  14. }
  15.  
  16.  
  17. }
  18.  
Success #stdin #stdout 0.21s 320832KB
stdin
Standard input is empty
stdout
tigh, 1, 2, tree, 4, high, tree, 7, 8, tree, high, 11, tree, 13, 14, tigh, 16, 17, tree, 19, high, tree, 22, 23, tree, high, 26, tree, 28, 29, tigh, 31, 32, tree, 34, high, tree, 37, 38, tree, high, 41, tree, 43, 44, tigh, 46, 47, tree, 49, high, tree, 52, 53, tree, high, 56, tree, 58, 59, tigh, 61, 62, tree, 64, high, tree, 67, 68, tree, high, 71, tree, 73, 74, tigh, 76, 77, tree, 79, high, tree, 82, 83, tree, high, 86, tree, 88, 89, tigh, 91, 92, tree, 94, high, tree, 97, 98, tree, high