輸入的代碼運行時只顯示了前半段,後半段沒有顯示,不知道怎麼回事,求幫解決
#include <iostream>
using namespace std;
int main()
{
for (int i = 1; i <= 4; i++)
{
for (int j = 1; j <= 4 - i; j++) cout << " ";
for (int k = 1; k <= 2 * i - 1; k++) cout << "*";
cout << endl;
}
for (int i = 3; i > 0; i--)
{
for (int j = 1; j <= 4 - i; j++) cout << " ";
for (int k = 1; k <= 2 * i - 1; k++) cout << "*";
cout << endl;
}
}
http://codepad.org/KMQoQMcz