等腰三角形
#include<stdio.h>int main()
{int n;scanf("%d",&n);if(n<=0)printf("error\n");for(int i=1;i<=n;i++){int j=2*i-1,t=n-i;while(t--)printf(" ");while(j--)printf("* ");printf("\n");}}
等腰三角形
#include<stdio.h>int main()
{int n;scanf("%d",&n);if(n<=0)printf("error\n");for(int i=1;i<=n;i++){int j=2*i-1+n-1,t=n-i;//这块换一下就行了while(t--)printf(" ");while(j--)printf("* ");printf("\n");}}