【发布时间】:2015-11-09 14:33:08
【问题描述】:
尽我所能,我不知道如何解决这个程序。我为它的俗气道歉,我是一名学习 Java 的学生,并且将其作为一种练习。
Lixnor is a mutant space trader in the Andromeda IV galaxy. He is low on
supplies and funds and has trouble paying for the fuel that his ship
requires. Every SGW (Standard Galactic Week) his partner, Ronxil gives him
the coordinates for 2 valuable lost crates floating in space. The
coordinates are sent in a file named "Coordinates.txt". The files always
have 3 lines, each line containing a coordinate in the format (x,y,z) where
x,y,z are integers. Due to Lixnor's lack of funds, he must first calculate
whether it would be worth it for him to go pick them up. The first
coordinates given are Lixnor's current coordinates, and the next two are the
coordinates of the two crates. Lixnor must pick them up, then return to his
original location. Write a program for Lixnor that calculates the distance
he must travel in order to pick up the crates and return to his original
position.
(24,-34,46)
(1,2,3)
(123,-1,0)
具体来说,我无法让 Java 读取文件。任何帮助都会很棒!
【问题讨论】:
-
学习Java文件阅读器。尝试这样做,然后返回一些代码。那么我们可能会提供帮助。
标签: java file-io filereader