vdjalov

Untitled

Oct 2nd, 2018
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Exercise {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. Scanner scanner = new Scanner(System.in);
  10.  
  11. long mine = Integer.parseInt(scanner.nextLine());
  12. long harvest = 0;
  13. long days = 0;
  14.  
  15. if(mine >=100 ){
  16. do{
  17. days++;
  18. harvest = (harvest + mine) - 26;
  19. mine = mine - 10;
  20. }while(mine >= 100);
  21. harvest = harvest - 26;
  22. System.out.printf("%d%n%d", days,harvest);
  23. }else{
  24. System.out.printf("%d%n%d",0,0);
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment