Windows 7 64bit / Visual Studio 2013 Express 32bit
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
char ch = 'A';
int height = -1;
printf_s("Input Height : ");
scanf_s("%d", &height);
for (int heightCount = 0; heightCount < height; heightCount++)
{
for (int spaceCount = 0; spaceCount < height - heightCount; spaceCount++)
{
printf_s(" ");
}
for (int widthCount = 0; widthCount < heightCount; widthCount++)
{
printf_s("%c ", ch);
ch++;
if (ch > 90)
{
ch = 'A';
}
}
ch = 'A';
printf_s("\n");
}
return 0;
}
Output
| [C언어 연습문제] 숫자 피라미드 (1) | 2020.01.20 |
|---|---|
| [C언어 연습문제] 별로 사선 채우기 (0) | 2014.06.04 |
| Windows Console Command TREE 를 구현해보자 (0) | 2014.05.27 |