i failed at something

This commit is contained in:
vala 2019-12-02 19:12:34 +01:00
parent 32094afe55
commit 80146fc041

View File

@ -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();
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
}
public static int FuelNeeded(int inp){
return ((inp/3)*2);
return ((inp/3)-2);
}
}