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.
|
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
-
- public class FuelFinder{
- 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);
- }
- }
|