Skip to content

Instantly share code, notes, and snippets.

@AdamJB
Created November 22, 2014 23:38
Show Gist options
  • Save AdamJB/eeed163a26dcc17c8c21 to your computer and use it in GitHub Desktop.
Save AdamJB/eeed163a26dcc17c8c21 to your computer and use it in GitHub Desktop.
Interview Street Reading Input
public class Solution {
private static String INPUT_FILE_NAME = "input";
protected static int solveMeFirst(int a, int b) {
return a + b;
}
public static void main(String[] args) {
Scanner in = new Scanner(getInputStream());
int a = in.nextInt();
int b = in.nextInt();
int sum = solveMeFirst(a, b);
System.out.println(sum);
}
private static InputStream getInputStream() {
try {
return new FileInputStream(System.getProperty("user.dir") + "/" + INPUT_FILE_NAME);
} catch (FileNotFoundException e) {
return System.in;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment