Advertisement
danaildobrev

Time

Feb 21st, 2022
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.     public static void main(String[] args) {
  4.         Scanner sc = new Scanner(System.in);
  5.  
  6.         int d = sc.nextInt();
  7.         int h = sc.nextInt();
  8.         int m = sc.nextInt();
  9.         int s = sc.nextInt();
  10.  
  11.         int daysS = 86400;
  12.         int hoursS = 3600;
  13.         int minutesS = 60;
  14.         int secondsS = 1;
  15.  
  16.         int result = (d * daysS) + (h * hoursS) + (m * minutesS) + (s * secondsS);
  17.  
  18.         System.out.println(result);
  19.  
  20.  
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement