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


  2. public class World {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub

  5.                 Scanner c=new Scanner(System.in);
  6.                 int s;
  7.                 float y;
  8.                 System.out.print("請輸入整數一:");
  9.                 s=Integer.parseInt(c.nextLine());
  10.                 System.out.println(s+6);
  11.                 System.out.print("請輸入小數二:");
  12.                 y=Float.parseFloat(c.nextLine());
  13.                 System.out.print(y+6.5);
  14.         }

  15. }
複製代碼

TOP

返回列表