Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ex05TrainingLab {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double length = Double.parseDouble(scanner.nextLine()) * 100; // метри в сантиметри
- double width = Double.parseDouble(scanner.nextLine()) * 100; // метри в сантиметри
- if (300 <= width && width <= length && length <= 10000) // ограниченията от метри в сантиметри
- {
- double desks_per_row_width = (width - 100) / 70;
- double desks_per_row_length = length / 120;
- double work_space = (Math.floor(desks_per_row_width) * Math.floor(desks_per_row_length)) - 3;
- System.out.println((int) work_space);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement