Advertisement
markopizzy

Untitled

Jan 24th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class JF_Spice_Flow {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int yield = Integer.parseInt(scanner.nextLine());
  8. int pureLeft = 0;
  9. int daysWorked = 0;
  10. boolean isFinished = false;
  11.  
  12. while (yield >= 100) {
  13. isFinished = true;
  14. pureLeft += yield - 26;
  15. yield -= 10;
  16. daysWorked++;
  17. }
  18. if (isFinished) {
  19. pureLeft -= 26;
  20. System.out.println(daysWorked);
  21. System.out.println(String.format("%d", pureLeft));
  22. }
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement