#include<stdio.h>
int main(void){ void pyramid(int n); pyramid(5);return 0;
}void pyramid(int n){ int i,j;for(i=1;i<=n;i++){
for(j=1;j<=n-i;j++) printf(" "); for(j=1;j<=i;j++) printf("%d",i); putchar('\n'); }}本文共 269 字,大约阅读时间需要 1 分钟。
#include<stdio.h>
int main(void){ void pyramid(int n); pyramid(5);return 0;
}void pyramid(int n){ int i,j;for(i=1;i<=n;i++){
for(j=1;j<=n-i;j++) printf(" "); for(j=1;j<=i;j++) printf("%d",i); putchar('\n'); }}转载于:https://www.cnblogs.com/jiangjiali/p/3353803.html