{int i,j;
int a[10][10];
printf("\n");
for(i=0;i<10;i++)
{a[i][0]=1;
a[i][i]=1;}
for(i=2;i<10;i++)
for(j=1;j<i;j++)
a[i][j]=a[i-1][j-1]+a[i-1][j];
for(i=0;i<10;i++)
{for(j=0;j<=i;j++)
printf("%5d",a[i][j]);
printf("\n");
}
}
-----------------------------------------------------------------------------
【程序62】
题目:学习putpixel画点。
1.程序分析:
2.程序源代码:
#include "stdio.h"
#include "graphics.h"
main()
{
int i,j,driver=VGA,mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(YELLOW);
for(i=50;i<=230;i+=20)
for(j=50;j<=230;j++)
putpixel(i,j,1);
for(j=50;j<=230;j+=20)
for(i=50;i<=230;i++)
putpixel(i,j,1);
}
-----------------------------------------------------------------------------
【程序63】
题目:画椭圆ellipse
1.程序分析:
2.程序源代码:
#include "stdio.h"
#include "graphics.h"
#include "conio.h"
main()
{
int x=360,y=160,driver=VGA,mode=VGAHI;
int num=20,i;
int top,bottom;
initgraph(&driver,&mode,"");
top=y-30;
bottom=y-30;
for(i=0;i<num;i++)
{
ellipse(250,250,0,360,top,bottom);
top-=5;
bottom+=5;
}
getch();
}
---------------
http://www.qdxw.com.cn/yx/dwwf/2116713.html
http://www.fengone.com/bj/jsqy/2014/0404/468277.html
http://www.js0573.com/yx/jsfs/3853837.html
http://www.qdxw.com.cn/yx/dwwf/2116651.html
http://www.fengone.com/bj/zxzx/2014/0404/468283.html
http://www.qdxw.com.cn/yx/dwwf/2116719.html
http://www.changsha.cn/bj/bj/zxzx/2014/0404/538264.html
http://www.qdxw.com.cn/yx/dwwf/2116807.html
http://yiyuan.hangzhou.com.cn/jdbd/4208555.html
http://www.js0573.com/yx/sjbm/3853393.html
http://www.changsha.cn/bj/bj/zxzx/2014/0404/538267.html
http://www.qdxw.com.cn/yx/dwwf/2115966.html
http://www.fengone.com/bj/zxzx/2014/0404/468295.html
http://www.qdxw.com.cn/yx/dwwf/2115958.html
http://www.fengone.com/bj/zxzx/2014/0404/468301.html
http://www.js0573.com/yx/jsfs/3854272.html
http://www.changsha.cn/bj/yl/xywy/2014/0404/538269.html
http://www.fengone.com/bj/zxzx/2014/0404/468303.html
http://www.qdxw.com.cn/yx/dwwf/2116006.html
http://www.changsha.cn/bj/yl/zxjs/2014/0404/538270.html
http://www.qdxw.com.cn/yx/ysph/2118653.html