File tree Expand file tree Collapse file tree 1 file changed +30
-13
lines changed Expand file tree Collapse file tree 1 file changed +30
-13
lines changed Original file line number Diff line number Diff line change 1
1
import java .io .BufferedReader ;
2
+ import java .io .FileInputStream ;
2
3
import java .io .IOException ;
3
4
import java .io .InputStreamReader ;
5
+ import java .io .PrintStream ;
4
6
import java .io .PrintWriter ;
5
7
6
8
public class Main {
@@ -13,22 +15,37 @@ public class Main {
13
15
out = new PrintWriter (System .out );
14
16
}
15
17
16
- public static void main (String [] args ) throws IOException {
17
- Main m = new Main ();
18
- m .solve ();
19
- m .close ();
18
+ void solve () throws IOException {
20
19
}
21
20
22
- void close () {
23
- out .flush ();
24
- out .close ();
21
+ void close () throws IOException {
22
+ if (in != null ) {
23
+ in .close ();
24
+ }
25
+ if (out != null ) {
26
+ out .flush ();
27
+ out .close ();
28
+ }
25
29
}
26
30
27
- void solve () throws IOException {
28
- int t = Integer .parseInt (in .readLine ());
29
- while (t > 0 ) {
30
- t --;
31
- int n = Integer .parseInt (in .readLine ());
31
+ public static void main (String [] args ) throws Exception {
32
+ FileInputStream inStream = null ;
33
+ PrintStream outStream = null ;
34
+ boolean isLocal = System .getProperty ("os.name" ).equals ("Mac OS X" );
35
+ if (isLocal ) {
36
+ inStream = new FileInputStream ("1.in" );
37
+ // outStream = new PrintStream("1.out");
38
+ System .setIn (inStream );
39
+ // System.setOut(outStream);
40
+ }
41
+
42
+ Main main = new Main ();
43
+ main .solve ();
44
+ main .close ();
45
+
46
+ if (isLocal ) {
47
+ inStream .close ();
48
+ // outStream.close();
32
49
}
33
50
}
34
- }
51
+ }
You can’t perform that action at this time.
0 commit comments