my shitty java code, from absolute basics to basics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
475B

  1. import java.io.File;
  2. import java.io.FileNotFoundException;
  3. import java.util.Scanner;
  4. public class FuelFinder{
  5. public static void main(String[] vala){
  6. File file = new File("input.txt");
  7. try {
  8. Scanner sc = new Scanner(file);
  9. while (sc.hasNextLine()) {
  10. int i = sc.nextInt();
  11. System.out.println(i);
  12. }
  13. sc.close();
  14. }
  15. catch (FileNotFoundException e) {
  16. e.printStackTrace();
  17. }
  18. }
  19. public static int FuelNeeded(int inp){
  20. return ((inp/3)-2);
  21. }
  22. }