Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package kursova_rabota;
- import java.util.Scanner;
- public class dve_chetiri {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner sc = new Scanner(System.in);
- int x = Integer.parseInt(sc.nextLine());
- double y = Double.parseDouble(sc.nextLine());
- int z = Integer.parseInt(sc.nextLine());
- int rabotnici = Integer.parseInt(sc.nextLine());
- double ObshtoGrozde = Math.abs(x * y);
- double ObshtoVino = Math.abs((ObshtoGrozde / 2.5) * 0.4);
- if (ObshtoVino < z) {
- double NedostigashtoVino = Math.round(z - ObshtoVino);
- System.out.println("It will be a tough winter! More " + NedostigashtoVino + " liters wine needed");
- } else {
- double OstavashtiLitri = ObshtoVino - z;
- double VinoZaRabotnicite = OstavashtiLitri / rabotnici;
- System.out.println("Good harvest this year! Total wine: " + ObshtoVino + " liters.");
- System.out.format(OstavashtiLitri + " left -> " + Math.floor(VinoZaRabotnicite) + " liters per person");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement