本帖最後由 陳璽安 於 2019-7-1 15:26 編輯
- import java.io.Console;
- public class Ch05
- {
- pulib static void main(String args[])
- {
- String strl,str2;
- Console c=System.console();
- System.out.print("輸入字串一: ");
- strl=c.readline();
- System.out.print("字串一: "+strl");
- System.out.print("輸入字串二: ");
- strl=c.readline();
- System.out.print("字串二: "+strl");
- }
- }
複製代碼- import java.io.Console;
- public class Ch05
- {
- public static void main(String args[])
- {
- String str1, str2;
- Console c=System.console();
- str1=c.readLine("輸入字串1: ");
- str2=c.readLine("輸入字串2: ");
- System.out.println("字串1: "+str1);
- System.out.println("字串2: "+str2);
- }
- }
複製代碼 |