File tree Expand file tree Collapse file tree 2 files changed +12
-21
lines changed
src/main/java/com/lzw/solutions Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Original file line number Diff line number Diff line change 66import java .io .PrintWriter ;
77
88public class Main {
9+ private static final BufferedReader in = new BufferedReader (new InputStreamReader (System .in ));
10+ private static final PrintWriter out = new PrintWriter (System .out , true );
911
10- private BufferedReader in ;
11- private PrintWriter out ;
12-
13- public Main () {
14- in = new BufferedReader (new InputStreamReader (System .in ));
15- out = new PrintWriter (System .out );
16- }
17-
18- public static void main (String [] args ) throws IOException {
19- Main m = new Main ();
20- m .solve ();
21- m .close ();
22- }
23-
24- private void close () {
25- out .flush ();
26- out .close ();
27- }
28-
29- private void solve () throws IOException {
12+ private static void solve () throws IOException {
3013 int t = Integer .parseInt (in .readLine ());
3114 while (t -- > 0 ) {
3215 int n = Integer .parseInt (in .readLine ());
@@ -35,4 +18,9 @@ private void solve() throws IOException {
3518 out .println (s );
3619 }
3720 }
21+
22+ public static void main (String [] args ) throws IOException {
23+ solve ();
24+ out .close ();
25+ }
3826}
Original file line number Diff line number Diff line change 11package com .lzw .solutions .sample .pjava_sample_buf ;
22
3- import java .io .*;
3+ import java .io .BufferedReader ;
4+ import java .io .IOException ;
5+ import java .io .InputStreamReader ;
6+ import java .io .PrintWriter ;
47
58public class Main {
69 private static final BufferedReader in = new BufferedReader (new InputStreamReader (System .in ));
You can’t perform that action at this time.
0 commit comments