上课闲来无事 写了个小程序 画了一棵树 .
程序代码:#include <stdio.h>
#include <windows.h>
void test();
int main()
{
int i=0;
system("title 一颗小树!");
system("color EC");
system("mode con cols=23 lines=33");//窗口宽度高度
while(i++<3){
test();
}
printf("\n");
system("pause");
return 0;
}
void test() //树
{
int i,j,n; for(i=0;i<=9;i++){
for(n=9;n>i-1;n--)
printf(" ");
for(j=i;j>0;j--)
printf("%d",j);
for(j=0;j<=i;j++)
printf("%d",j);
printf("\n");
}
}
见笑了 .









