打印形状

编写程序,使之能根据N的值(0-20),输出以下图形:

     *****
    *****
   *****
  *****
 *****

 1 #include<stdio.h>
 2 #define MAX 20
 3 int main(){
 4     int i,j,n;
 5     printf("Enter(0---%d)",MAX);
 6     scanf("%d",&n);
 7     for(i=1;i<=n;i++){
 8         for(j=1;j<=n-i;j++)
 9             printf(" ");
10         for(j=1;j<=n;j++)
11             printf("*");
12             printf("
");
13     }
14     return 0;
15 }
原文地址:https://www.cnblogs.com/geziyu/p/8734802.html