Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #define ILOSC_PIETER 20
  4. using namespace std;
  5.  
  6. int SilniaRek(int n)
  7. {
  8.     if(n == 0) return 1;
  9.     if(n == 1) return 1;
  10.     return SilniaRek(n - 1) * n;
  11. }
  12.  
  13. int main(int argc, char* argv[])
  14. {
  15.     int liczPietra = 0;
  16.     int liczDlugosc = liczPietra;
  17.     while(liczPietra <= ILOSC_PIETER)
  18.     {
  19.         for(int i = -1; i < liczDlugosc && liczDlugosc < ILOSC_PIETER ; i++)
  20.             cout << "*";
  21.         cout << endl;
  22.         liczDlugosc++;
  23.         liczPietra++;
  24.     }
  25.     cout << endl << SilniaRek(6);
  26.     getch();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement