A_Marinov

Problem_01

Jun 7th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Honeycombs {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int bees = Integer.parseInt(scan.nextLine());
  8.         int flowers = Integer.parseInt(scan.nextLine());
  9.  
  10.         double honey = bees * flowers * 0.21;
  11.         double honeycombs = Math.floor(honey / 100);
  12.  
  13.         System.out.printf("%.0f honeycombs filled.%n", honeycombs);
  14.         System.out.printf("%.2f grams of honey left.", honey - honeycombs * 100);
  15.     }
  16. }
Add Comment
Please, Sign In to add comment