SHARE
TWEET

Untitled

a guest Sep 16th, 2019 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.        
  13.         System.out.print("Введите радиус 2 окружности: ");
  14.         double r2 = scan.nextInt();
  15.         System.out.print("Введите радиус 3 окружности: ");
  16.         double r3 = scan.nextInt();
  17.  
  18.  
  19.         double s1 = ((r3 + r3)*(r3+r3) - circleArea(r3));
  20.         double s2 = (circleArea(r2) - circleArea(r1))*0.625;
  21.         double S = s1+s2;
  22.  
  23.         System.out.println(S);
  24.     }
  25.    
  26.     private static double circleArea(double r) {
  27.         return Math.PI*r*r;
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top