Advertisement
Guest User

trojkat

a guest
May 23rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int wybor;
  6. int main()
  7. {
  8.    cout << "*******MENU**********\n"
  9.            "1. Narysuj trojkat\n"
  10.            "2. Nie rysuj trojkata\n"
  11.            "*********************\n"
  12.  
  13.             "Wybierz: \n";
  14.             cin>> wybor;
  15.         switch(wybor) {
  16.         case 1 :
  17.             {
  18.     int nilosc;
  19.  
  20.     cout << "Wprowadź liczbe 8: ";
  21.     cin >> nilosc;
  22.  
  23.     for(int i = 1; i <= nilosc; ++i)
  24.     {
  25.         for(int j = 1; j <= i; ++j)
  26.         {
  27.             cout << "# ";
  28.         }
  29.         cout << "\n";
  30.     }
  31. }
  32.  
  33.  
  34.         break;
  35.         case 2 :
  36.             {
  37.                 cout << "Przykro mi :(\n";
  38.             }
  39.             default :
  40.             {
  41.                 cout << "Nie wybrales dostepnych opcji!";
  42.             }
  43.         }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement