class Triangle
{ public static void f(int a)
{ for (int i=0; i<=a;i++)
{ for (int j=i;j<a;j++)
{System.out.print(" ");}
for (int j=0; j<2*i+1;j++)
{System.out.print("*");}
System.out.println();}
}
}
class TriangleTest
{
public static void main(String[] args)
{ Triangle.f(3);
}
} |
|