import java.io.*;
public class Prablem7
{
public static void main(String[] args)
{
try {
int a[] = new int[3];
InputStreamReader sr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sr);
System.out.print("Enter 3 Number: ");
for (int i = 0; i < 3; i++)
{
a[i] = Integer.parseInt(br.readLine());
}
for (int count = 0; count < 3; count++)
{
for (int i = 1; i <= a[count]; i++)
{
for (int j = a[count]; j > i; j--)
{
System.out.print(" ");
}
for (int k = 1; k <= i; k++)
{
System.out.print(k + " ");
}
System.out.println();
}
}
} catch (Exception ex)
{
System.out.println(ex);
}
}
}
public class Prablem7
{
public static void main(String[] args)
{
try {
int a[] = new int[3];
InputStreamReader sr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sr);
System.out.print("Enter 3 Number: ");
for (int i = 0; i < 3; i++)
{
a[i] = Integer.parseInt(br.readLine());
}
for (int count = 0; count < 3; count++)
{
for (int i = 1; i <= a[count]; i++)
{
for (int j = a[count]; j > i; j--)
{
System.out.print(" ");
}
for (int k = 1; k <= i; k++)
{
System.out.print(k + " ");
}
System.out.println();
}
}
} catch (Exception ex)
{
System.out.println(ex);
}
}
}
|
No comments:
Post a Comment