AcWing 613. 面积 - Java
原题链接
简单
作者:
KYCygni
,
2021-02-28 00:56:29
,
所有人可见
,
阅读 321
Java 代码
/**4 MDKJ
“Never let the fear of striking out keep you from playing the game.”
— Babe Ruth
*/
import java.util.Scanner;
public class Main
{
static final double PI = 3.14159;
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
double a = cin.nextDouble();
double b = cin.nextDouble();
double c = cin.nextDouble();
System.out.println("TRIANGULO: " + String.format("%.3f", a * c /2.0));
System.out.println("CIRCULO: " + String.format("%.3f", c * c * PI));
System.out.println("TRAPEZIO: " + String.format("%.3f", ((a + b) * c / 2.0)));
System.out.println("QUADRADO: " + String.format("%.3f", b * b));
System.out.println("RETANGULO: " + String.format("%.3f", a * b));
}
}