Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int size() {
- int a;
- cin >> a;
- return a;
- }
- void drawManyChars(char c, int k) {
- while (k > 0) {
- cout << c;
- k--;
- }
- }
- void upperPart(int n) {
- int b = n;
- while (n > 0) {
- drawManyChars(' ', n);
- n--;
- drawManyChars('*', b-n);
- cout << endl;
- b++;
- }
- }
- void lowPart(int n) {
- drawManyChars(' ', n);
- drawManyChars('*', 1);
- }
- void tree() {
- int ab = size();
- upperPart(ab);
- lowPart(ab);
- }
- int main() {
- tree();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement