- import java.unti.Arrays
- public class Ch18
- {
- public static void main(String args[])
- {
- Scanner s=new Scanner(System.in);
- String str1, str2;
- int a;
- float b;
- System.out.print("請輸入一字串(帶空白)");
- str1=.nextline();
- System.out.print("請輸入一字串(不帶空白)");
- str2=.next();
- System.out.print("請輸入整數");
- a=s.nextInt();
- System.out.print("請輸入一浮點數:");
- b=s.nextfloat();
- System.out.println(b);
- }
- }
複製代碼 |