Browse Source

i failed at something

master
vala 4 years ago
parent
commit
80146fc041
1 changed files with 18 additions and 5 deletions
  1. +18
    -5
      advent-of-code/01/FuelFinder.java

+ 18
- 5
advent-of-code/01/FuelFinder.java 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);
}
}


Loading…
Cancel
Save