import java.util.Scanner;
public class HomeWork0702 {
public static void main(String[] argv) {
Scanner kbd = new Scanner(System.in);
System.out.println("請輸入10個字串");
String[] str = new String[10];//建立儲存10個字串的陣列
for(int i = 0; i < str.length; i++){
System.out.println("請輸入第" + (i+1) + "個字串");
str[i] = kbd.nextLine();
}
for(int i = 0; i < str.length; i++){
System.out.print(str[i] + " ");
}
kbd.close();
}
}
沒有留言:
張貼留言