#include <iostream>
using namespace std;
int main()
{
for(int i = 1; i <= 5; ++i)
{
for(int j = 1; j <= i; ++j)
{
if(i == j || j == 1) {
cout << "* ";
} else {
cout << " ";
}
}
cout << "\n";
}
return 0;
}
قمت بالتعديل على كود الصديق في الإعلى بتثبيت عدد الأسطر.