deyanivanov966

EXAM 25.10 // 06. Moon

Oct 27th, 2020 (edited)
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Moon {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int Speed = Integer.parseInt(scanner.nextLine());
  10.         int Fuel = Integer.parseInt(scanner.nextLine());
  11.         double Distance = 768800;
  12.  
  13.         double Time = Distance / Speed;
  14.         double TotalTime = Math.ceil(Time + 3);
  15.         System.out.printf("%.0f%n", TotalTime);
  16.         double TotalFuel = (Fuel * Distance) / 100;
  17.         System.out.printf("%.0f", TotalFuel);
  18.  
  19.     }
  20. }
  21.  
Add Comment
Please, Sign In to add comment