[STARTER] UVa program template JAVA

[java]
import java.io.IOException;

class Main implements Runnable {

public static void main(String[] args) {
Main main = new Main();
main.run();

}

@Override
public void run() {

ExecutorTemplate exe = new ExecutorTemplate();
exe.run();

}

}

class ExecutorTemplate implements Runnable {

@Override
public void run() {
//YOUR CODE HERE
}

private String readLine() {

byte line[] = new byte[255];
int length = 0;
int input = -1;
try {
while (length < 255) {// Read until maxlength
input = System.in.read();
if ((input < 0) || (input == '\n')) {
break; // or until end of line ninput
}
line[length++] += input;
}

if ((input < 0) && (length == 0)) {
return null; // eof
}
return new String(line, 0, length);
} catch (IOException e) {
return null;
}
}

}

[/java]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s