desislava_topuzakova

02. Radians to Degrees

Oct 5th, 2020
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class RadiansToDegrees_02 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //radians -> degrees
  7.         //1. прочитаме радианите
  8.         //2. градуси = радианите * 180 / пи
  9.         //3. принтираме градуси
  10.         double radians = Double.parseDouble(scanner.nextLine());
  11.         double degrees = radians * 180 / Math.PI;
  12.         System.out.printf("%.0f", Math.floor(degrees));
  13.     }
  14. }
Add Comment
Please, Sign In to add comment