Ligh7_of_H3av3n

02.AND Processor

Oct 21st, 2023
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package ZadachiOtIzpita2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ANDProcessor {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int countProssors = Integer.parseInt(scanner.nextLine());
  10.         int countWorkers = Integer.parseInt(scanner.nextLine());
  11.         int workingDay = Integer.parseInt(scanner.nextLine());
  12.  
  13.         double sum = workingDay * countWorkers * 8;
  14.         double midle = Math.floor(sum / 3);
  15.  
  16.         if (midle < countProssors)
  17.         {
  18.             System.out.printf("Losses: -> %.2f BGN", (countProssors - midle) * 110.1);
  19.         }
  20.         else
  21.         {
  22.             System.out.printf("Profit: -> %.2f BGN", (midle - countProssors) * 110.1);
  23.         }
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment