chillurbrain

Untitled

Sep 22nd, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TaskClocks
  4. {
  5.     public static void main(String[] args)
  6.     {
  7.         Scanner sc = new Scanner(System.in);
  8.         double deg = 0.0;
  9.         int res = 0;
  10.         int h, m, s;
  11.         System.out.print("Введите кол-во часов (0 - 23): ");
  12.         h = sc.nextInt();
  13.         System.out.println();
  14.  
  15.         System.out.print("Введите кол-во минут (0 - 59): ");
  16.         m = sc.nextInt();
  17.         System.out.println();
  18.  
  19.         System.out.print("Введите кол-во секунд (0 - 59): ");
  20.         s = sc.nextInt();
  21.         System.out.println();
  22.  
  23.         deg = (h * 15) + (m * 0.25) + (s * 0.0041);
  24.         System.out.println(deg + " deg");
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment