import java.io.*;
public class Mirror
{
public static void main()throws IOException
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.println();
String a[][] = new String[9][9];
int i = 0, j = 0;
for(i = 0;i<9;i++)
{
for(j = 0;j<9;j++)
{
if(i!=3 || i!=4 || i!=5)
{
if(j!=3 || j!=4 || j!=5)
{
a[i][j] = ” “;
}
}
}
}
System.out.println(“Enter 9 numbers”);
for(i = 3;i<6;i++)
{
for(j = 3;j<6;j++)
{
a[i][j] = in.readLine();
}
}
for(i = 3;i<6;i++)
{
for(j = 0;j<3;j++)
{
a[i][j] = a[i][5-j];
a[i][j+6] = a[i][5-j];
}
}
for(j = 3;j<6;j++)
{
for(i = 0;i<3;i++)
{
a[i][j] = a[5-i][j];
a[i+6][j] = a[5-i][j];
}
}
for(i = 0;i<9;i++)
{
for(j = 0;j<9;j++)
{
System.out.print(a[i][j]);
}
System.out.println();
}
}
}
Related Article of JAVA
No comments:
Post a Comment