Advertisement
tenachev

Birthday

Apr 13th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Birthday {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int length = Integer.parseInt(scanner.nextLine());
  8.         int width = Integer.parseInt(scanner.nextLine());
  9.         int height = Integer.parseInt(scanner.nextLine());
  10.         double percent = Double.parseDouble(scanner.nextLine());
  11.  
  12.         int volume = length * width * height;
  13.         double litersDefault = volume * 0.001;
  14.         double percent1 = percent * 0.01;
  15.         double litersNeeded = litersDefault * (1 - percent1);
  16.  
  17.         System.out.printf("%.3f", litersNeeded);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement