C语言实现空心倒三角形输出
#include<stdio.h> int main(){ int n,i,j; scanf("%d",&n); for(i=n;i>=1;i--){ for(j=1;j<=n-i;j++){ printf(" "); } for(j=1;j<=i;j++){ if(i==1||i==n){ printf("* "); } else{ if(j==1||j==i){ printf("* "); } else{ printf(" "); } } } printf("\n"); } return 0; }
原文地址: https://www.cveoy.top/t/topic/nw1B 著作权归作者所有。请勿转载和采集!