问题描述:
输出以下图形:
A
A B
A B C
A B C D
A B C D E
A B C D E F
A B C D E F G
A B C D E F G H
A B C D E F G H I
A B C D E F G H I J
A B C D E F G H I J K
A B C D E F G H I J K L
A B C D E F G H I J K L M
A B C D E F G H I J K L M N
A B C D E F G H I J K L M N O
A B C D E F G H I J K L M N O P
A B C D E F G H I J K L M N O P Q
A B C D E F G H I J K L M N O P Q R
A B C D E F G H I J K L M N O P Q R S
A B C D E F G H I J K L M N O P Q R S T
A B C D E F G H I J K L M N O P Q R S T U
A B C D E F G H I J K L M N O P Q R S T U V
A B C D E F G H I J K L M N O P Q R S T U V W
A B C D E F G H I J K L M N O P Q R S T U V W X
A B C D E F G H I J K L M N O P Q R S T U V W X Y
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
代码展示:
1 #include<stdio.h> 2 int main(){ 3 int i,j,k; 4 for(i=0; i<26; i++){ 5 for(j=30; j>=i+3; j--){ 6 printf(" "); 7 } 8 for(k=65; k<=65+i; k++){ 9 printf("%c ", k); 10 } 11 printf("\n"); 12 } 13 return 0; 14 }
运行截图: