Starting git repo for working on files
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
public class BandMatrix
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int n = Integer.parseInt(args[0]);
|
||||
int width = Integer.parseInt(args[1]);
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
for (int j = 0; j < n; j++)
|
||||
{
|
||||
if ((j - i <= width) && (i -j <= width))
|
||||
{
|
||||
System.out.print(" * ");
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.print(" 0 ");
|
||||
}
|
||||
}
|
||||
System.out.println("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user