Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. 2(2)Дано висотатрикутника. Вивести на екранрівнобедренийтрикутник та його контур:
  2. *
  3. ***
  4. *****
  5. *******
  6. */
  7.  
  8. #include <iostream>
  9. using namespace std;
  10. int main ()
  11. {
  12.     int n = 5;
  13.         for (int i = 1; i <= n; ++i){
  14.            
  15.             for (int j = 1; j <= n - 1; ++j){
  16.                 if (i >= 5){
  17.                     cout << "*";
  18.                 }
  19.                 else
  20.                     cout << "-";
  21.                    
  22.             }
  23.             for (int y = 1; y == 1; y++){
  24.                 cout << "*";
  25.             }
  26.             for (int z = 1; z <= n - 1; ++z){
  27.                 if (i >= 5){
  28.                     cout << "*";
  29.                 }
  30.                 else
  31.                     cout << "-";
  32.                    
  33.             }
  34.     cout << endl;
  35.         }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement