Advertisement
Spocoman

Change Tiles

Sep 2nd, 2024
39
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 Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int areaSide = Integer.parseInt(scanner.nextLine());
  7.         double tileWidth = Double.parseDouble(scanner.nextLine()),
  8.                 tileLength = Double.parseDouble(scanner.nextLine());
  9.         int benchWidth = Integer.parseInt(scanner.nextLine()),
  10.                 benchLength = Integer.parseInt(scanner.nextLine());
  11.  
  12.         int area = areaSide * areaSide - benchLength * benchWidth;
  13.         double tileArea = tileWidth * tileLength;
  14.         double tiles = area / tileArea;
  15.         double time = tiles * 0.2;
  16.  
  17.         System.out.printf("%f\n%f\n", tiles, time);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement