返回列表 發帖
  1. import java.util.Scanner;

  2. public class cc {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.                 Scanner c = new Scanner(System.in);
  6.                 String s1,s2;
  7.                 int a;
  8.                 float b;
  9.                 System.out.print("輸入整數:");
  10.                 a= Integer.parseInt(c.nextLine());
  11.                 System.out.println("整數+6="+(a+6));
  12.                 System.out.print("輸入小數:");
  13.                 b= Float.parseFloat(c.nextLine());
  14.                 System.out.println("小數+8="+(b+8));
  15.         }

  16. }
複製代碼

TOP

返回列表