Advertisement
uktcar

01.3.05TrainingLab

Mar 6th, 2023 (edited)
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ex05TrainingLab {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         double length = Double.parseDouble(scanner.nextLine()) * 100;    // метри в сантиметри
  9.         double width = Double.parseDouble(scanner.nextLine()) * 100;    // метри в сантиметри
  10.  
  11.         if (300 <= width && width <= length && length <= 10000)    // ограниченията от метри в сантиметри
  12.         {
  13.             double desks_per_row_width = (width - 100) / 70;
  14.             double desks_per_row_length = length / 120;
  15.             double work_space = (Math.floor(desks_per_row_width) * Math.floor(desks_per_row_length)) - 3;
  16.  
  17.             System.out.println((int) work_space);
  18.         }
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement