/*
ITS A PASCAL TRIANGLE IMPLEMENTED IN JAVA
GENERATED OUTPUT
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
*/
import java.io.*;
class pascal
{
public static void main(String args[]) throws IOException
{
int i=0,n=0,b=1,c=2,d=2,e=0,f=2,g=3;
DataInputStream ds=new DataInputStream(System.in);
int []a=new int[50];
System.out.println("Enter count");
n=Integer.parseInt(ds.readLine());
for(i=0;i<=n;i++)
{
if(i==0||i==b||i==c)
{
a[i]=1;
System.out.print(a[i]+"\t");
}
else
{
e=i-d;
a[i]=a[e]+a[++e];
System.out.print(a[i]+"\t");
}
if(i==0)
{
System.out.println();
}
if(i==c)
{
System.out.println();
b=b+f;
f++;
c=c+g;
g++;
d++;
}
}
}
}
ITS A PASCAL TRIANGLE IMPLEMENTED IN JAVA
GENERATED OUTPUT
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
*/
import java.io.*;
class pascal
{
public static void main(String args[]) throws IOException
{
int i=0,n=0,b=1,c=2,d=2,e=0,f=2,g=3;
DataInputStream ds=new DataInputStream(System.in);
int []a=new int[50];
System.out.println("Enter count");
n=Integer.parseInt(ds.readLine());
for(i=0;i<=n;i++)
{
if(i==0||i==b||i==c)
{
a[i]=1;
System.out.print(a[i]+"\t");
}
else
{
e=i-d;
a[i]=a[e]+a[++e];
System.out.print(a[i]+"\t");
}
if(i==0)
{
System.out.println();
}
if(i==c)
{
System.out.println();
b=b+f;
f++;
c=c+g;
g++;
d++;
}
}
}
}