Untitled

mail@pastecode.io avatar
unknown
java
7 months ago
752 B
3
Indexable
Never
import java.util.Scanner;

public class *** {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        System.out.println("Вариант: (для примеров 100)");
        int N = Integer.parseInt(scan.nextLine());
        int a = Integer.parseInt(scan.nextLine());
        int b = Integer.parseInt(scan.nextLine());
        int c = Integer.parseInt(scan.nextLine());
        int d = Integer.parseInt(scan.nextLine());

        System.out.printf("%.2f", area(a, b, c, d) * Math.pow(N, 2));
    }

    public static double area(int a, int b, int c, int d) {
        double r = Math.sqrt(Math.pow((c - a), 2) + Math.pow((d - b), 2));
        double res = Math.PI * (r * r);
        return res;
    }
}
Leave a Comment