---
# System prepended metadata

title: '#Java 解題系統過不了'

---

#Java 解題系統過不了


以下為程式碼
```java=
import java.text.*;
import java.util.Scanner;

public class Q1 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		DecimalFormat f1 = new DecimalFormat("0.00");
		
		
		float Height = Float.parseFloat(scanner.next());
		float Width = Float.parseFloat(scanner.next());
		
		
		float perimeter = 2*(Height + Width);
		float area = Height*Width;
		
		System.out.println("Heigth = " + f1.format(Height));
		System.out.println("Width = " + f1.format(Width));
		System.out.println("Perimeter = " + f1.format(perimeter));
		System.out.println("Area = " + f1.format(area));
		
		scanner.close();
		

	}

}
```


