Advertisement
Spocoman

Cone

Sep 3rd, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double radius = Double.parseDouble(scanner.nextLine()),
  7.                 height = Double.parseDouble(scanner.nextLine()),
  8.                 volume = Math.PI * radius * radius * height / 3,
  9.                 area = Math.PI * radius * (radius + Math.sqrt(radius * radius + height * height));
  10.  
  11.         System.out.printf("volume = %.4f\narea = %.4f\n", volume, area);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement