當前位置:編程學習大全網 - 電腦編程 - java中,從鍵盤中輸入5個字符串存入數組中..然後反向輸出這5個字符串(編程序)....望高手指點

java中,從鍵盤中輸入5個字符串存入數組中..然後反向輸出這5個字符串(編程序)....望高手指點

import java.util.Scanner;

public class a{

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

String[] str= new String[5];

System.out.println("請從控制臺輸入5個字符串,按回車確認!");

for(int i=0;i<5;i++){

str[i]=sc.nextLine();

}

for(int j=4;j>=0;j--){

System.out.println(str[j]);

}

}

}

  • 上一篇:在UG中怎麽去除兩個相貫實體之間的材料
  • 下一篇:VB編程添加了皮膚控件的問題。懂的來。
  • copyright 2024編程學習大全網