Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.print("Введите радиус 1 окружности: ");
- double r1 = scan.nextInt();
- System.out.print("Введите радиус 2 окружности: ");
- double r2 = scan.nextInt();
- System.out.print("Введите радиус 3 окружности: ");
- double r3 = scan.nextInt();
- double s1 = ((r3 + r3) * (r3 + r3) - circleArea(r3));
- double s2 = (circleArea(r2) - circleArea(r1))*0.625;
- double S = s1+s2;
- System.out.println(S);
- }
- private static double circleArea(double r) {
- return Math.PI*r*r;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement