import java.io.*;
class pppp
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("entre the n for array(n*n");
int n=Integer.parseInt(br.readLine());
int a[][]=new int[n][n];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
a[i][j]=Integer.parseInt(br.readLine());
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(i>j)
{
System.out.print(" ");
}
else
{
System.out.print(a[i][j]);
}
}
System.out.println();
}
}
}
No comments:
Post a Comment
HAY THAKYOU FOE VISIT