Advertisement
Spocoman

Mining Rig

Sep 7th, 2024
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 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 videosPrice = Integer.parseInt(scanner.nextLine()),
  7.                 cablesPrice = Integer.parseInt(scanner.nextLine()),
  8.                 computerPrice = (videosPrice + cablesPrice) * 13 + 1000;
  9.         double powerPerDay = Double.parseDouble(scanner.nextLine()),
  10.                 profitPerDay = Double.parseDouble(scanner.nextLine()),
  11.                 cashbackDays = Math.ceil(computerPrice / ((profitPerDay - powerPerDay) * 13));
  12.  
  13.         System.out.printf("%d\n%d\n", computerPrice, (int) cashbackDays);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement