Created
November 22, 2014 23:38
-
-
Save AdamJB/eeed163a26dcc17c8c21 to your computer and use it in GitHub Desktop.
Interview Street Reading Input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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