i failed at something
This commit is contained in:
parent
32094afe55
commit
80146fc041
@ -1,12 +1,25 @@
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundExeption;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class FuelFinder{
|
||||
public static void main(string[] vala){
|
||||
int[] tVals ={12,14,1969,100756};
|
||||
for (int a:tVals){
|
||||
System.out.println("FuelNeeded(a)");
|
||||
public static void main(String[] vala){
|
||||
File file = new File("input.txt");
|
||||
try {
|
||||
Scanner sc = new Scanner(file);
|
||||
while (sc.hasNextLine()) {
|
||||
int i = sc.nextInt();
|
||||
System.out.println(i);
|
||||
}
|
||||
sc.close();
|
||||
}
|
||||
public static int FuelNeeded(int inp){
|
||||
return ((inp/3)*2);
|
||||
catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static int FuelNeeded(int inp){
|
||||
return ((inp/3)-2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user