Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int n, i, j, ii;
- cin>>n;
- for(i = 1; i <= n; i++)
- {
- for(j = n - i; j >= 1; j--)
- {
- cout << ' ';
- }
- for(j = 1; j <= i * 2 - 1; j++)
- {
- cout << i;
- }
- cout << '\n';
- }
- for(i = n - 1; i >= 1; i--)
- {
- for(j = n - 1; j >= 1; j--)
- {
- cout << ' ';
- }
- for(j = i * 2 - 1; j >= 1; j--)
- {
- cout << i;
- }
- cout << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement