0412 별찍기과제

민우이·2022년 4월 13일
0

/ 5)
// 5
* // 456
***
// 34567
*** // 2345678
* //123456789
/
for (int i = 0; i < 5; i++)
{
for (int k = 5; k > i + 1; k--)
{
cout << " ";
}
for (int s = 0; s < 2
i + 1; s++)
{
cout << "";
}
for (int k = 5; k > i + 1; k--)
{
cout << " ";
}
cout << endl;
}
cout << endl;
/
6)

    *********
     *******
      *****
       ***
        *
    */
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < i; j++)
                {
                    cout << " ";
                }
                for (int s = 10; s > 2 * i + 1; s--)
                {
                    cout << "*";
                }
                for (int j = 0; j < i; j++)
                {
                    cout << " ";
                }
                cout << endl;
            }
            cout << endl;

0개의 댓글

관련 채용 정보