Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double radius = Double.parseDouble(scanner.nextLine()),
- height = Double.parseDouble(scanner.nextLine()),
- volume = Math.PI * radius * radius * height / 3,
- area = Math.PI * radius * (radius + Math.sqrt(radius * radius + height * height));
- System.out.printf("volume = %.4f\narea = %.4f\n", volume, area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement