SHARE
TWEET

Sort Input

DulcetAirman Jul 1st, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ch.claude_martin;
  2.  
  3. import static java.lang.System.*;
  4. import java.util.Scanner;
  5. import java.util.stream.IntStream;
  6.  
  7. public final class SomeClass {
  8.   public static void main(String... args) {
  9.     out.println("Enter five lines of Text:");
  10.     try (var s = new Scanner(in)) {
  11.       IntStream.range(0, 5).mapToObj(i -> s.nextLine()).sorted().forEach(out::println);
  12.     }
  13.   }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top