public class kotak
{
public static void main(String args[])
{
int x,y;
int pola[][]={{1,1,1,1,1},{1,0,0,0,1},{1,0,0,0,1},{1,0,0,0,1},{1,1,1,1,1}};
for(y=0;y<5;y++)
{
for(x=0;x<5;x++)
{
if(pola[y][x]==1)
System.out.print("#");
else
System.out.print(" ");
}
System.out.println(" ");
}
}
}
Tidak ada komentar:
Posting Komentar