Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5.  
  6. public class Main {
  7.     public static void main(String[] args) {
  8.         Scanner scan = new Scanner(System.in);
  9.  
  10.         System.out.print("Введите радиус 1 окружности: ");
  11.         double r1 = scan.nextInt();
  12.         System.out.print("Введите радиус 2 окружности: ");
  13.         double r2 = scan.nextInt();
  14.         System.out.print("Введите радиус 3 окружности: ");
  15.         double r3 = scan.nextInt();
  16.  
  17.  
  18.         double s1 = ((r3 + r3) * (r3 + r3) - circleArea(r3));
  19.         double s2 = (circleArea(r2) - circleArea(r1))*0.625;
  20.         double S = s1+s2;
  21.  
  22.         System.out.println(S);
  23.     }
  24.  
  25.     private static double circleArea(double r) {
  26.         return Math.PI*r*r;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement