-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharraypola.java
34 lines (34 loc) · 1.13 KB
/
arraypola.java
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
import java.io.*;
public class arraypola{
public static void main (String[]args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int [][]polaArray=new int [7][5];
for(int ulang1=0;ulang1<7;ulang1++){
for(int ulang2=0;ulang2<5;ulang2++){
System.out.print("Data Baris-"+(ulang1+1)+" "+"kolom-"+(ulang2+1)+" : ");
polaArray[ulang1][ulang2] = Integer.parseInt(br.readLine());
}
}
System.out.println(" ");
System.out.println("================================== Input Pola Array ==================================");
for(int ulang1=0;ulang1<7;ulang1++){
for(int ulang2=0;ulang2<5;ulang2++){
System.out.print(polaArray[ulang1][ulang2]+" ");
}
System.out.println(" ");
}
System.out.println(" ");
System.out.println("================================== Output Pola Array ==================================");
for(int ulang1=0;ulang1<7;ulang1++){
for(int ulang2=0;ulang2<5;ulang2++){
if(polaArray[ulang1][ulang2]==1){
System.out.print("#");
}
else{
System.out.print(" ");
}
}
System.out.println(" ");
}
}
}