JosepRivaille

P10694: Barres (3)

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