Advertisement
Spocoman

09. Centuries to Minutes

Oct 17th, 2024
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int centuries = Integer.parseInt(scanner.nextLine());
  7.         double years = centuries * 100,
  8.             days = years * 365.2422,
  9.             hours = days * 24,
  10.             minutes = hours * 60;
  11.  
  12.         System.out.printf("%d centuries = %.0f years = %.0f days = %.0f hours = %.0f minutes", centuries, years, days, hours, minutes);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement