import java.util.Scanner;
public class ex1
{
public static void main(String[] args)
{
Scanner input =new Scanner(System.in);
//Promt the user for input
//Compute a,b,area
System.out.println("請輸入矩形的長");
double a = input.nextDouble();
System.out.println("請輸入矩形的寬");
double b = input.nextDouble();
double area = a * b ;
//Display results
System.out.println("長=" + a + "寬=" + b +"的矩形面積是"
+ area );
}
}
2014年8月17日 星期日
java程式設計題目---公式計算【矩形面積】
設計一程式,輸入矩形的長和寬(皆為實數),計算面積並列印結果:
訂閱:
張貼留言 (Atom)
Go(Golang)程式語言 設定GCC
下載MSYS2: https://www.msys2.org/ 安裝 程式開始執行後輸入: pacman -Syu y y 在安裝目錄底下找到msys2.exe,雙擊執行 輸入指令: pacman -Su pacman -S --needed base-devel mingw-...
-
MNIST手寫數字辨識資料集 MNIST手寫數字辨識資料集 ,是由 Yann LeCun(揚·勒丘恩) 大神所蒐集,這位大神同時也是Convulution Nueral Networks(卷積神經網絡)的創始人,因此享有"卷積網絡之父"的美譽。關於這位大...
-
Write a program that reads an integer between 100 and 999, and show the result of the sum, product and difference of all its digits. For ex...
-
顯示語言 在一班情況下, Vsiual Studio Code (VSCode) 安裝完成後為英語版本,當然它也附有其他九種語言,分別是:英文(美國)、簡體中文、繁體中文、法文、德文、義大利文、日文、韓文、俄文、西班牙文。各個語言與其代碼對照如下表: Display ...
沒有留言:
張貼留言