File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ package practice ;
2+
3+ import java .io .BufferedReader ;
4+ import java .io .InputStreamReader ;
5+ import java .util .StringTokenizer ;
6+ import java .io .IOException ;
7+
8+ public class TakingUserInputInJava {
9+
10+ static class FastReader {
11+ BufferedReader br ;
12+ StringTokenizer st ;
13+
14+ public FastReader () {
15+ br = new BufferedReader (new InputStreamReader (System .in ));
16+ }
17+
18+ String next () {
19+ while (st == null || !st .hasMoreElements ()) {
20+ try {
21+ st = new StringTokenizer (br .readLine ());
22+ } catch (IOException e ) {
23+ e .printStackTrace ();
24+ }
25+ }
26+ return st .nextToken ();
27+ }
28+
29+ int nextInt () {
30+ return Integer .parseInt (next ());
31+ }
32+
33+ long nextLong () {
34+ return Long .parseLong (next ());
35+ }
36+
37+ double nextDouble () {
38+ return Double .parseDouble (next ());
39+ }
40+
41+ String nextLine () {
42+ String str = "" ;
43+ try {
44+ str = br .readLine ();
45+ } catch (IOException e ) {
46+ e .printStackTrace ();
47+ }
48+ return str ;
49+ }
50+
51+ }
52+ }
You canβt perform that action at this time.
0 commit comments