用C语言完成下面的操作
#include<stdio.h>main(){ int i,j; for(i=1;i<=9;i++){ for(j=1;j<=i;j++){ printf("%d",j); } printf("\n"); } for(i=9;i>0;i--){ for(j=1;j<i;j++){ printf("%d",j); } printf("\n"); }}
//已调试通过 程序很简单! #include<stdio.h>void main(){ int i=1; int j; while(i<10) { for(j=0;j<i;j++) { printf("%d",j+1); } printf("\n"); i++; } i--; i--; while(i>0) { for(j=0;j<i;j++) { printf("%d",j+1); } i--; printf("\n"); }}
#include "stdio.h"main(){ int i,j; for(j=1;j<=9;j++) { for(i=1;i<=j;i++) printf("%d",i); printf("\n"); } for(j=8;j>0;j--) { for(i=1;i<=j;i++) printf("%d",i); printf("\n"); }}WIN-TC 编译通过
#include <stdio.h> main() {int i,j; for(i=1;i<=9;i++) { for(j=1;j<=i;j++)printf("%d",j); printf("\n"); } for(--i;i>=1;i--) {for(j=1;j<i;j++)printf("%d",j); printf("\n");} getch(); }