Advertisement
Lyubohd

Untitled

Dec 19th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Mine {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int yield = Integer.parseInt(scan.nextLine());
  7.  
  8.         if (yield < 100) {
  9.             System.out.println(0);
  10.             System.out.println(0);
  11.         } else {
  12.             int days = 0;
  13.             int coal = 0;
  14.             while (yield >= 100) {
  15.                 days++;
  16.                 coal = coal + yield - 26;
  17.                 yield -= 10;
  18.             }
  19.             System.out.println(days);
  20.             System.out.println(coal - 26);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement