Created
November 16, 2021 04:39
-
-
Save AmolPardeshi99/c1c4e9fe79a2b764f2652931dd4b3810 to your computer and use it in GitHub Desktop.
Masai OJ Fast Input Output Template
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 { | |
static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); | |
public static void main(String[] args) throws IOException { | |
FastReader sc = new FastReader(); | |
// taking input same as scanner | |
eg. | |
int temp = sc.nextInt(); | |
long temp = sc.nextLong(); | |
String str = sc.next(); | |
// for printing --> simlar to System.out.print(); | |
bw.write("\n"); | |
bw.flush(); | |
} | |
static class FastReader { | |
BufferedReader br; | |
StringTokenizer st; | |
public FastReader() { | |
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; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment