Advertisement
Guest User

Untitled

a guest
Dec 10th, 2020
1,262
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 1
  1. import java.util.Scanner;
  2.  
  3. public class Moon {
  4.  
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. double speed = Double.parseDouble(scanner.nextLine());
  9. double needFuel = Double.parseDouble(scanner.nextLine());
  10. double distance = 384400 * 2;
  11. double time = distance / speed;
  12. double totalTime = time + 3;
  13. double fuel = needFuel * distance;
  14.  
  15. System.out.printf("%.0f%n", Math.ceil(totalTime));
  16. System.out.printf("%.0f", fuel / 100);
  17.  
  18. }
  19. }
  20.  
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement