1//Link: https://www.quora.com/How-do-I-can-get-n-lines-of-text-as-input-from-the-user-in-java
2
3//using Scanner
4
5import java.util.Scanner;
6public class ScannerDemo
7{
8 public static void main(String args[])
9 {
10 Scanner sc = new Scanner(System.in);
11 int n;
12 n=Integer.parseInt(sc.nextLine());
13 for(int i=1; i<=n; i++)
14 {
15 System.out.print("Enter input:");
16 String input = sc.nextLine();
17 System.out.println(input);
18 }
19 }
20}
21