luoni

TheaThePhotographer

May 27th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. package DataTypes;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class TheaThePhotographer {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. int picturesTaken = Integer.parseInt(scanner.nextLine());//1 000 000
  10. int filterTimePerPicture = Integer.parseInt(scanner.nextLine());//100 000
  11. int filterFactor = Integer.parseInt(scanner.nextLine());// в проценти
  12. int uploadingTimePerPicture = Integer.parseInt(scanner.nextLine());//100 000
  13.  
  14. // d:HH:mm:ss
  15. double goodPictures = Math.ceil(picturesTaken * filterFactor / 100);
  16. long filterTime = (long)picturesTaken * filterTimePerPicture;
  17. double uploadingTime = goodPictures * uploadingTimePerPicture;
  18. double totalTime = filterTime + uploadingTime;
  19.  
  20. long d = (long) totalTime / 86400;
  21. long hh = ((long) totalTime - d * 86400) / 3600;
  22. long mm = ((long) totalTime - d * 86400 - hh * 3600) / 60;
  23. long ss = (long) totalTime - d * 86400 - hh * 3600 - mm * 60;
  24.  
  25. System.out.printf("%01d:%02d:%02d:%02d", d, hh, mm, ss);
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment