This repository was archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcowsignal.java
More file actions
52 lines (47 loc) · 1.37 KB
/
cowsignal.java
File metadata and controls
52 lines (47 loc) · 1.37 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
51
52
import java.io.*;
import java.util.*;
public class cowsignal {
private static int K;
public static ArrayList<ArrayList<Character>> build(ArrayList<ArrayList<Character>> map,int y,char l){
for(int i=y*K;i<((y+1)*K);i++) {
for(int j=0;j<K;j++) {
map.get(i)
.add(l);
};
}
return map;
}
//private static final char s_OFF = 'B';
//private static final char s_ON = '.';
public static void main(String[] args) throws IOException{
BufferedReader f=new BufferedReader(new FileReader("cowsignal.in"));
StringTokenizer st=new StringTokenizer(f.readLine());
int M=Integer.parseInt(st.nextToken());
int N=Integer.parseInt(st.nextToken());
K=Integer.parseInt(st.nextToken());
String temp;
ArrayList<ArrayList<Character>> omap=new ArrayList<ArrayList<Character>>();
for(int i=0;i<(M*K);i++){
omap.add(new ArrayList<Character>());
}
System.out.println("M*K "+M*K);
//Character[][] map=new Character[M][N];
for(int i=0;i<M;i++) {
temp=f.readLine();
for(int j=0;j<N;j++) {
//map[i][j]=temp.charAt(j);
omap=build(omap,i,temp.charAt(j));
}
}
f.close();
PrintWriter out=new PrintWriter(new FileWriter("cowsignal.out"));
for(int i=0;i<(M*K);i++) {
for(int j=0;j<(N*K);j++) {
out.print(omap.get(i).get(j));
}
out.println();
}
out.flush();
out.close();
}
}