#include <stdio.h>
int main()
{
int n = 7;// prefer odd
int i,j;
int x = 0;
for(i = 1; i <= n; i++)
{
for(j = 0; j <= x; j++)
{
printf("%c", i + 64);
}
printf("\n");
if (i <= n / 2)
x++;
else
x--;
}
return 0;
}
#include <iostream.h>
int main()
{
int n = 7;// prefer odd
int x = 0;
for(int i = 1; i <= n; i++)
{
for(int j = 0; j <= x; j++)
{
cout<<(char)(i + 64);
}
cout<<endl;
if (i <= n / 2)
x++;
else
x--;
}
return 0;
}
class PatternProg
{
public static void main(String args[])
{
int n = 7; // prefer odd
int x = 0;
for (int i = 1; i <= n; i++)
{
for (int j = 0; j <= x; j++)
{
System.out.print((char)(i + 64));
}
System.out.println();
if (i <= n / 2)
{
x++;
}
else
{
x--;
}
}
}
}
using System;
class PatternProg
{
public static void Main()
{
int n = 7; // prefer odd
int x = 0;
for (int i = 1; i <= n; i++)
{
for (int j = 0; j <= x; j++)
{
Console.Write((char)(i + 64));
}
Console.WriteLine();
if (i <= n / 2)
{
x++;
}
else
{
x--;
}
}
Console.ReadKey(true);
}
}
n = 7 # prefer odd
d = 0
for x in range(0, n + 1):
for y in range(1, d + 1):
print(chr(x + 64), end="")
print()
if x <= n // 2:
d += 1
else:
d -= 1