Created
April 28, 2011 04:15
-
-
Save Ricket/945790 to your computer and use it in GitHub Desktop.
Template for programming competition Java program
This file contains hidden or 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
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.InputStreamReader; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
public class CompetitionEntry { | |
public static void main(String[] args) { | |
try { | |
if(InetAddress.getLocalHost().getHostName().equals("ricky-mbp")) { | |
try { | |
System.setIn(new FileInputStream(new File("/Users/ricky/Desktop/input.txt"))); | |
} catch (FileNotFoundException e1) { | |
System.out.println("Input file not found"); | |
System.exit(1); | |
} | |
} | |
} catch (UnknownHostException e1) { | |
} | |
InputStreamReader converter = new InputStreamReader(System.in); | |
BufferedReader in = new BufferedReader(converter); | |
// in.readLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment