Skip to content

Instantly share code, notes, and snippets.

@peterkos
Created November 22, 2014 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterkos/ee145a59cd6325476aa2 to your computer and use it in GitHub Desktop.
Save peterkos/ee145a59cd6325476aa2 to your computer and use it in GitHub Desktop.
The Golden Input Method
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public static void askForInputFile() throws FileNotFoundException {
Scanner in = new Scanner(new File("src/input.txt"));
int positionInquiry = in.nextInt();
position = new int[positionInquiry];
for (int i = 0; i < positionInquiry; i++) {
int inputPosition = in.nextInt();
position[i] = inputPosition;
} //End of for loop
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment