Skip to content

Commit 2c423fd

Browse files
committed
Refactor Newspaper
1 parent e327f0f commit 2c423fd

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

UVa/Newspaper.java

+3-31
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ ACM International Collegiate Programming Contest (abbreviated
3535

3636
package UVa;
3737

38-
import java.io.BufferedReader;
39-
import java.io.PrintWriter;
4038
import java.text.DecimalFormat;
39+
import java.util.HashMap;
40+
import java.util.Map;
4141
import java.util.Scanner;
4242

4343
public class Newspaper {
4444

45-
static void solve() throws Exception {
45+
public static void main(String[] args) {
4646
Scanner input = new Scanner(System.in);
4747
int numberOfTestCases = input.nextInt();
4848
while (numberOfTestCases != 0) {
@@ -71,34 +71,6 @@ static void solve() throws Exception {
7171
System.out.println(sumFormatted + "$");
7272
numberOfTestCases--;
7373
}
74-
input.close();
75-
}
76-
77-
static int nextInt() throws IOException {
78-
return parseInt(next());
79-
}
80-
81-
static String next() throws IOException {
82-
while (tok == null || !tok.hasMoreTokens()) {
83-
tok = new StringTokenizer(in.readLine());
84-
}
85-
return tok.nextToken();
86-
}
87-
88-
public static void main(String[] args) {
89-
try {
90-
in = new BufferedReader(new InputStreamReader(System.in));
91-
out = new PrintWriter(new OutputStreamWriter(System.out));
92-
solve();
93-
in.close();
94-
out.close();
95-
} catch (Throwable e) {
96-
e.printStackTrace();
97-
exit(0);
98-
}
9974
}
10075

101-
static BufferedReader in;
102-
static PrintWriter out;
103-
static StringTokenizer tok;
10476
}

0 commit comments

Comments
 (0)