Advertisement
desislava_topuzakova

Рожден ден

Jan 19th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BirthdayPresent {
  4.     public static void main(String[] agrs) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int lenghtCm = Integer.parseInt(scan.nextLine());
  8.         int widthCm = Integer.parseInt(scan.nextLine());
  9.         int heightCm = Integer.parseInt(scan.nextLine());
  10.         double percent = Double.parseDouble(scan.nextLine());
  11.  
  12.         int obem = lenghtCm * widthCm * heightCm;
  13.         double liters=obem*0.001;
  14.         double percent1=percent*0.01;
  15.         double needLiters=liters*(1-percent1);
  16.  
  17.         System.out.printf("%.3f",needLiters);
  18.        // System.out.printf("%.3f",liters*(1-percent1));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement