//编译环境:VC++6.0,如果是TC,改头文件为stdio,改cout为printf函数即可
#define ROW 4
//ROW是打印的行数,这里是4行
#include
void main()
{
char ch='A';
for(int i=0;i
for(int j=2*(ROW-i)-1;j>0;j--)
cout<
}
return;
}
#include
int print_line(int indent, int count, int c) {
while (indent -- > 0) {
printf("\t");
}
while (count -- > 0) {
printf("%c", c);
}
printf("\n");
return 0;
}
int main(void) {
int i;
int c;
c = 'A';
for (i = 0; i < 4; i++) {
print_line(i, 7 - i * 2, c);
c++;
}
return 0;
}