Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2. (2)Дано висотатрикутника. Вивести на екранрівнобедренийтрикутник та його контур:
- *
- ***
- *****
- *******
- */
- #include <iostream>
- using namespace std;
- int main ()
- {
- int n = 5;
- for (int i = 1; i <= n; ++i){
- for (int j = 1; j <= n - 1; ++j){
- if (i >= 5){
- cout << "*";
- }
- else
- cout << "-";
- }
- for (int y = 1; y == 1; y++){
- cout << "*";
- }
- for (int z = 1; z <= n - 1; ++z){
- if (i >= 5){
- cout << "*";
- }
- else
- cout << "-";
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement