Private Sub Command1_Click()
t = 6'(这里设置从A起的字母个数,A-F时 为6 A-Z时为26)
For i = 1 To t
s = ""
For j = 1 To 2 * i - 1
s = s & Chr(i + 64)
Next
Print Space(t - i) & s & Space(t - i)
Next
For i = 1 To t - 1
s = ""
For j = 1 To (t - i) * 2 - 1
s = s & Chr(64 + t - i)
Next
Print Space(i) & s & Space(i)
Next
End Sub
C语言输出一个菱形图案(有程序)
#include <stdio.h>
void main(){
int i,j,k;
for(i=0;i<=3;i++){
for(j=0;j<=2-i;j++)
printf(" ");
for(k=0;k<=2*i;k++)
printf("*");
printf("\n");}
for(i=0;i<=2;i++){
for(j=0;j<=i;j++)
printf(" ");
for(k=0;k<=4-2*i;k++)
printf("*");
printf("\n");
广告 您可能关注的内容 |