public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请指定字符数组长度");
int length = sc.nextInt();
String[] arr = new String[length];
System.out.println("请输入字符串");
int i = 0;
while (i < length) {
arr[i] = sc.nextLine();
i++;
}