Skip to content

Instantly share code, notes, and snippets.

@abhinavpanse
Created July 30, 2017 17:49
Show Gist options
  • Save abhinavpanse/2bf2ccfe9b6d0cbf72eceb1c89d99ceb to your computer and use it in GitHub Desktop.
Save abhinavpanse/2bf2ccfe9b6d0cbf72eceb1c89d99ceb to your computer and use it in GitHub Desktop.
My Java FastIO
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
Solve();
}
static void Solve() throws IOException {
Print out = new Print();
Scan in = new Scan();
out.close();
}
}
class Scan {
BufferedReader br;
StringTokenizer st;
public Scan() {
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
class Print {
private final BufferedWriter bw;
public Print() {
bw = new BufferedWriter(new OutputStreamWriter(System.out));
}
public void print(String str) throws IOException {
bw.append(str);
}
public void printLine(String str) throws IOException {
print(str);
bw.append("\n");
}
public void close() throws IOException {
bw.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment