Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0
- 0 1 0
- 0 1 2 1 0
- 0 1 2 3 2 1 0
- 0 1 2 1 0
- 0 1 0
- 0
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned i,k=0,n;
- cout<<"n= "; cin>>n;
- while(k<=n)
- {
- for (i=0;i<=k;i++)
- cout<<i;
- for (i=k;i>0;i--)
- cout<<i-1;
- cout<<endl;
- k++;
- }
- k=n;
- while (k)
- {
- k--;
- for (i=0;i<=k;i++)
- cout<<i;
- for (i=k;i>0;i--)
- cout<<i-1;
- cout<<endl;
- }
- }
- unsigned i;
- unsigned k = 0;
- unsigned n;
- cout << "n= ";
- cin >> n;
Add Comment
Please, Sign In to add comment