Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void stars(int n)
- {
- if (!n)
- {
- cout << endl;
- return;
- }
- cout << '*';
- stars(n - 1);
- }
- void tri1(int n)
- {
- if (!n)
- return;
- tri1(n - 1);
- stars(n);
- }
- void tri2(int n)
- {
- if (!n)
- return;
- stars(n);
- tri2(n - 1);
- }
- signed main()
- {
- int n;
- cin >> n;
- tri1(n);
- tri2(n - 1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement