Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package testprojects;
- import java.util.Scanner;
- public class NextLineProblem {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int length = console.nextInt();
- String[] strings = new String[length];
- console.nextLine();
- for (int index = 0; index < length; index++) {
- strings[index] = console.nextLine();
- }
- for(String str:strings){
- System.out.println(str);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement