Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void barres(int n) {
  5.     if (n > 2) barres(n-1);
  6.     cout << "*" << endl;
  7.     if (n != 1) {
  8.         for (int i = n; i > 0; --i) cout << "*";
  9.         cout << endl;
  10.     }
  11. }
  12.  
  13. int main() {
  14.     int n;
  15.     for (cin >> n; n > 0; --n) barres(n);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement