Advertisement
Guest User

Untitled

a guest
May 27th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MainClass {
  4.  
  5. public static void main(String args[]) {
  6. Scanner scanner = new Scanner(System.in);
  7. int yield = Integer.parseInt(scanner.nextLine());
  8. int days = 0;
  9. int spice = yield;
  10. int total = 0;
  11. while (yield>=100){
  12. days++;
  13. spice = yield-26;
  14. yield -= 10;//101
  15. //85
  16. total +=spice;
  17. if(yield<100){
  18. total -= 26;
  19. }
  20. }
  21.  
  22. System.out.println(days);
  23. System.out.println(total);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement