File tree Expand file tree Collapse file tree 2 files changed +10
-32
lines changed
src/main/java/com/lzw/solutions Expand file tree Collapse file tree 2 files changed +10
-32
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ private void solve() throws IOException {
3131 while (t -- > 0 ) {
3232 int n = Integer .parseInt (in .readLine ());
3333 String s = in .readLine ();
34+ assert (s .length () == n );
3435 out .println (s );
3536 }
3637 }
Original file line number Diff line number Diff line change 11package com .lzw .solutions .sample .pjava_sample_buf ;
22
3- import java .io .BufferedReader ;
4- import java .io .IOException ;
5- import java .io .InputStreamReader ;
6- import java .io .PrintWriter ;
3+ import java .io .*;
74
85public class Main {
6+ private static final BufferedReader in = new BufferedReader (new InputStreamReader (System .in ));
7+ private static final PrintWriter out = new PrintWriter (System .out , true );
98
10- BufferedReader in ;
11- PrintWriter out ;
12-
13- Main () {
14- in = new BufferedReader (new InputStreamReader (System .in ));
15- out = new PrintWriter (System .out );
16- }
17-
18- int readInt () throws IOException {
19- return Integer .parseInt (in .readLine ());
9+ private static void solve () throws IOException {
10+ // your code here
2011 }
2112
22- void solve () throws IOException {}
23-
24- void close () throws IOException {
25- if (in != null ) {
26- in .close ();
27- }
28- if (out != null ) {
29- out .flush ();
30- out .close ();
31- }
32- }
33-
34- public static void main (String [] args ) throws Exception {
35-
36- Main main = new Main ();
37- main .solve ();
38- main .close ();
13+ public static void main (String [] args ) throws IOException {
14+ solve ();
15+ out .close ();
3916 }
40- }
17+ }
You can’t perform that action at this time.
0 commit comments