Advertisement
desislava_topuzakova

04. Vacation Books List

Sep 11th, 2022
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class VacationBooksList_04 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. //вход: брой старници(int), стр/час(int), брой дни (int)
  7. //1. общо часове за четене = брой страници / стр за час
  8. //2. часове на ден = общо часове за четене / бр.дни
  9.  
  10. int countPages = Integer.parseInt(scanner.nextLine());
  11. int pagesPerHour = Integer.parseInt(scanner.nextLine());
  12. int countDays = Integer.parseInt(scanner.nextLine());
  13.  
  14. int totalHours = countPages / pagesPerHour;
  15. int hoursPerDay = totalHours / countDays;
  16. System.out.println(hoursPerDay);
  17.  
  18.  
  19. }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement