Created
July 30, 2017 17:49
-
-
Save abhinavpanse/2bf2ccfe9b6d0cbf72eceb1c89d99ceb to your computer and use it in GitHub Desktop.
My Java FastIO
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.*; | |
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