import java.util.Scanner; public class o30 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int size = input.nextInt(); String a[] = new String[size]; for (int i = 0; i < size; i++) { a[i] = input.nextLine(); } for (int i = 0; i < size; i++) { System.out.print(a[i]); } } } 

Closed due to the fact that the essence of the question is not clear to the participants 0xdb , user192664, user300000, Kromster , kot-da-vinci Oct 25 '18 at 17:25 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    I would use the Char class.

     char mass[] = new char[10]; Scanner sc = new Scanner(System.in); for (int i = 0; i < mass.length; i++) { mass[i] = sc.next().charAt(0); } 
       int i = 0; while(i < size){ String s = input.nextLine(); if(s.length() == 1){ a[i] = input.nextLine(); i++; } }