Advertisement
finderabc

DanceHall

Oct 18th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P01_DanceHall {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double hallLm = Double.parseDouble(scanner.nextLine());
  8.         double hallWm = Double.parseDouble(scanner.nextLine());
  9.         double closetAm = Double.parseDouble(scanner.nextLine());
  10.  
  11.         double hallAreaCm = (hallLm * 100.0) * (hallWm * 100.0);
  12.  
  13.         double closetAreaCm = (closetAm * 100.0) * (closetAm * 100.0);
  14.         double bench = hallAreaCm / 10.0;
  15.         double freeSpace = hallAreaCm - closetAreaCm - bench;
  16.  
  17.         double countDancer = freeSpace / (40.0 + 7000.0);
  18.  
  19.         System.out.printf("%.0f", Math.floor(countDancer));
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement