Desc :
Source Code :
#include <iostream>
using namespace std;
int main()
{
char ch = '*';
int offset = 4;
for (int i = 1, j=0; i<= offset; i++,j=0)
{
for (int k=1; k <= offset -i ; k++) // 좌측에 공백 출력
cout << " ";
while (j != 2 * i - 1)
{
cout << "*";
j++;
}
cout << endl;
}
}
Result :
'C++' 카테고리의 다른 글
[C++] 044 실수 반올림하기 round (0) | 2021.03.22 |
---|---|
[C++] 043 실수 소수점 버리기 floor, ceil (0) | 2021.03.22 |
[C++] 041 피보나치 수열 (for) (0) | 2021.03.22 |
[C++] 040 구구단 출력하기 (for) (0) | 2021.03.18 |
[C++]039 조건 순환문 do ~ while ~ continue ~ break (0) | 2021.03.18 |