Se citeste n. Sa se afiseze urmatoarele forme. In exemplu n=4:

1)

1 2 3 4
1 2 3
1 2
1

#include<iostream.h>
void main()
{
int i,j,n;
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i+1;j++)
cout<<j<<" ";
cout<<endl;
}
}

2)

1 1 1 1
2 2 2
3 3
4

#include<iostream.h>
void main()
{
int i,j,n;
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i+1;j++)
cout<<i<<" ";
cout<<endl;
}
}

4)

4 3 2 1
4 3 2
4 3
4

#include<iostream.h>
void main()
{
int i,j,n;
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
{
for(j=1;j<=n-i+1;j++)
cout<<n-j+1<<" ";
cout<<endl;
}
}