-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathSimple.java
More file actions
50 lines (42 loc) · 1.58 KB
/
Simple.java
File metadata and controls
50 lines (42 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.io.*;
import java.util.*;
public class Simple
{
public static void main(String[] args)
throws Exception
{
String fInFileName = "/Users/lwy08/Downloads/input.txt";
String fOutFileName = "/Users/lwy08/Downloads/output.txt";
String fEncoding = "UTF-8";
Scanner sc = new Scanner(new FileInputStream(fInFileName), fEncoding);
Writer out = new OutputStreamWriter(new FileOutputStream(fOutFileName),
fEncoding);
// using system's default charset encoding
// in = new Scanner(new FileReader(new File(filename)));
// out = new PrintWriter(new FileWriter(new File(filename)));
// using stdin
// in = new BufferedReader(new InputStreamReader(System.in));
// out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
// System.out)));
int cases = sc.nextInt();
for (int cc = 1; cc <= cases; cc++) {
// for each case - read input
int H = sc.nextInt();
int W = sc.nextInt();
int M = sc.nextInt();
System.out.println(H + " " + W + " " + M);
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
System.out.print(sc.nextInt() + " ");
}
System.out.println();
}
// solve()
String result = String.format("Case #%d: %d\n", cc, 0);
System.err.print(result);
out.write(result);
} // end for each case
sc.close();
out.close();
}
}