Advertisement
Guest User

Untitled

a guest
Feb 1st, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1.  
  2.  
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class TheaThePhotographer {
  7.     public static void main(String[] args) {
  8.         Scanner s = new Scanner(System.in);
  9.  
  10.        long numberOfPictures = Integer.parseInt(s.nextLine());
  11.        long filterTimeSecondsPerPic =Integer.parseInt(s.nextLine());
  12.        long filterFactor=Integer.parseInt(s.nextLine());
  13.        long timeUpploadPerPic=Integer.parseInt(s.nextLine());
  14.  
  15.         double procent=filterFactor/100.0;
  16.         double usefull=Math.ceil(procent*numberOfPictures);
  17.         long fullTime=(long)numberOfPictures*filterTimeSecondsPerPic;
  18.         long fullUpploadTime=(long)usefull*timeUpploadPerPic;
  19.         long totalTime=(long)(fullUpploadTime+fullTime);
  20.  
  21.  
  22.  
  23.         long day=0;
  24.         long hours=0;
  25.         long minutes=0;
  26.         long secunds=totalTime;
  27.  
  28.         secunds = totalTime % 60;
  29.         totalTime = totalTime / 60;
  30.         minutes =totalTime%60;
  31.         totalTime=totalTime/60;
  32.         hours = totalTime%24;
  33.         totalTime=totalTime/24;
  34.         day=totalTime%365;
  35.         totalTime=totalTime/365;
  36.  
  37.         System.out.printf("%d:%02d:%02d:%02d",day,hours,minutes,secunds);
  38.  
  39.  
  40.  
  41.  
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement