Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions HomeWork2/2HwKobzystyiMaksym
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <iostream>
using namespace std;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отвыкайте от использования всего пространства имен


int main() {
int h, d = 2;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а зачем вам тут d?

cout << "\nEnter length of triangle's side: ";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

непонял а при чем тут сообщение вычесление стороны триугольника?

cin >> h;
cout << endl;
for (int i = 1; i <= h; i++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

предложение вам давать переменным типа i и j более читабельные имена, т.к. контекст имено в вашем коде немного не понятен

for (int j = 1; j < h * 2; j++) {
if (i <= h * 2 && i >= h - j + 1 && j <= i + h - 1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

напишите коментарий выше что делает этот if

cout << "*";
else
cout << " ";
}
cout << endl;
}
d++;
int value1;
cin >> value1;
return 0;
}