Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. int treatedPatients = 0;
  2. int untreatedPatients = 0;
  3. int countOfDoctor = 7;
  4.  
  5. for (int day = 1; day <= period; day++){
  6. int currentPatients = scanner.nextInt();
  7.  
  8. if ((day % 3 == 0) && (untreatedPatients > treatedPatients)){
  9. countOfDoctor++;
  10. }
  11.  
  12. if (currentPatients > countOfDoctor) {
  13. treatedPatients += countOfDoctor;
  14. untreatedPatients += currentPatients - countOfDoctor;
  15. }else{
  16. treatedPatients += currentPatients;
  17. }
  18. }
  19. System.out.printf("izlekuvani %d ", treatedPatients);
  20. System.out.printf("che umrat %d", untreatedPatients);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement