Half diamond star
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
if(a>=3 && a<=100)
{
for(int i=1;i<=a;i++){
for(int j=1;j<=i;j++)
System.out.print("*");
System.out.print("\n");
}
for(int i=a;i>1;i--){
for(int j=1;j<i;j++)
System.out.print("*");
System.out.print("\n");
}
}
else
System.out.print("The pattern is not possible");
}
}
12345
1234
123
12
1
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=a-i+1;j++)
{
System.out.print(j);
}
System.out.println();
}
}
}
x000x
0x0x0
00x00
0x0x0
x000x
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=a;j++)
{
if(i==j || j==a-i+1)
System.out.print("x");
else
System.out.print("0");
}
System.out.println();
}
}
}
0xx
x0x
xx0
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=a;j++)
{
if(i==j)
System.out.print("0");
else
System.out.print("x");
}
System.out.println();
}
}
}
54321
54321
54321
54321
54321
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=a;j>=1;j--)
System.out.print(j+" ");
System.out.println();
}
}
}
AAAAA
BBBBB
CCCCC
DDDDD
EEEEEE
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=a;j++)
{
System.out.format("%c ",i+64);
}
System.out.println();
}
}
}
12345
2345
345
45
5
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=i;j<=a;j++)
{
System.out.print(j+" ");
}
System.out.println();
}
}
}
1
12
123
1234
12345
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=i;j++)
{
System.out.format("%d",j);
}
System.out.println();
}
}
}
EEEEE
DDDD
CCC
BB
A
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=a;i>=1;i--)
{
for(int j=1;j<=i;j++)
{
System.out.format("%c ",i+64);
}
System.out.println();
}
}
}
11111
22222
33333
44444
55555
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=a;j++)
{
System.out.format("%d ",i);
}
System.out.println();
}
}
}
5 5
4 4
3
2 2
1 1
import java.util.*;
class praveen{
public static void main(String args[]){
int a;
Scanner s=new Scanner(System.in);
a=s.nextInt();
for(int i=1;i<=a;i++)
{
for(int j=1;j<=a;j++)
{
if(i==j || j==a-i+1)
System.out.format("%d ",a-i+1);
else
System.out.print(" ");
}
System.out.println();
}
}
}