标签:io os ar strong for sp on c amp
#include <stdio.h>
int main(int argc, const char * argv[]) {
char cost,top;
cost=getchar();
if (cost>=‘a‘&&cost<=‘z‘) {
top=‘a‘;
}else if (cost>=‘A‘&&cost<=‘Z‘)
{
top=‘A‘;
}
int h=cost-top;
for (int j=0; j<=h; j++) {
for (int k=h;k>j ; k--) {
printf(" ");
}
for (int l=0; l<j; l++) {
printf("%c",top+l );
}
for (int g=j; g>=0; g--) {
printf("%c",top+g);
}
printf("\n");
}
return 0;
打印结果为:
A
ABA
ABCBA
ABCDCBA
标签:io os ar strong for sp on c amp
原文地址:http://www.cnblogs.com/a514875560/p/3980035.html