Scanner sc=new Scanner(System.in); String s=""; while(sc.hasNext()) { s=sc.next()+s; sc=sc.nextLine(); }
Scanner sc=new Scanner(System.in); String s=""; while(sc.hasNextLine()) { s=sc.nextLine() + s; } System.out.println(s);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)