Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cout << "Enter n: ";
- cin >> n;
- int i, j, s;
- for(i = 1; i <= n; i++)
- {
- for(s = n - 1; s >= i; s--)
- {
- cout << " ";
- }
- for(j = 1; j <= i; j++)
- {
- if(i % 2 == 0)
- cout << (char)
- (36) << " ";
- else
- cout << (char)
- (35) << " ";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement