【正文】
jMAXPTS 。 iMAXPTS 。 /* Move to next increment */}circle( xcenter, ycenter, radius )。points[i].y = ycenter (int)( sin(rads) * radius * AspectRatio )。 ++i ){ /* Determine circle intercepts */rads = (double)angle * PI / 。 /* Begin at zero degrees */for( i=0 。step = 360 / MAXPTS。 /* Determine the center of circle */ycenter = h / 2。w = 。vp )。printf( MoveTo / LineTo Demonstration )。int radius, angle, step。struct PTS points[MAXPTS]。double AspectRatio=?! 。海篿nclude include include include include include include define MAXPTS 15define PI struct PTS {int x,y。}getch()。left+=5。rectangle(202*i,202*i,10*(i+2),10*(i+2))。i++){ellipse(250,250,0,360,right,left)。for(i=0。driver,amp。int left=20,right=50。::include include include main(){int driver=VGA,mode=VGAHI。}getch()。top=5。inum。bottom=y30。mode,)。initgraph(amp。int num=20,i。i++) putpixel(i,j,1)。j+=20) for(i=50。for(j=50。j=230。i=230。setbkcolor(YELLOW)。driver,amp。: ?。篿nclude include main(){int i,j,driver=VGA,mode=VGAHI。 printf(\n)。j=i。i10。j++) a[i][j]=a[i1][j1]+a[i1][j]。i++) for(j=1。}for(i=2。i++) {a[i][0]=1。for(i=0。int a[10][10]。} color=(color=MAXCOLOR)?0:++color。 if(y2=TOP||y2=BOTTOM) dy2=dy2?!?if(y1=TOP||y1=BOTTOM) dy1=dy1。y2+dy2。y1+=dy1。while(!kbhit()){ line(x1,y1,x2,y2)。dx1=dy1=2。mode,)。initgraph(amp。driver=VGA。int count=0。int x2,y2?! 。海篿nclude define LEFT 0define TOP 0define RIGHT 639define BOTTOM 479define LINES 400define MAXCOLOR 15main(){int driver,mode,error?!?}}restorecrtmode()?! ?y=ceil(y0+48*sin(a)*B)。j++) { a=(2*PAI/16)*i+(2*PAI/180)*k1?!?} for(j=1。 setcolor(2)。 x=ceil(x0+48*cos(a))。i=16。k++){ setcolor(3)。for(k=0。floodfill(202,100,WHITE)。getch()。/* Make 0 time normal size letters */settextstyle(DEFAULT_FONT,HORIZ_DIR,0)。}setcolor(3)。 setcolor(2)。 x=ceil(x0+48*cos(a))。i16。circle(x0,y0,50)。circle(x0,y0,10)。x0=150。setcolor(3)。driver,amp。mode=CGAC0。float a。}【程序59】題目:畫圖,綜合例子。setcolor(2)。outtextxy(150,40,How beautiful it is!)。y1=y1+5。y0=y05。rectangle(x0,y0,x1,y1)。i=18。x1=275。y0=263。setbkcolor(YELLOW)。driver,amp。mode=VGAHI。:include main(){int x0,y0,y1,x1,driver,mode,i。}}【程序58】題目:畫圖,學(xué)用rectangle畫方形。y0=y0+5。line(x0,y0,x0,y1)。i=20。y0=263。}x0=263。y1=y1+5。y0=y05。line(x0,y0,x0,y1)。i=18。x1=275。y0=263。setbkcolor(GREEN)。driver,amp。mode=VGAHI。float j=12,k。: ?。篿nclude main(){int driver,mode,i。j=j+。circle(310,250,k)。i=25。setbkcolor(YELLOW)。driver,amp。mode=VGAHI。float j=1,k=1。} 【程序56】題目:畫圖,學(xué)用circle畫圓形。printf(\40: The a39。s 1 plement(decimal) is %d \n,b)。b=~a。:include main(){int a,b?! 。簙0=1。printf(%o\n%o\n,a,d)。d=bamp。b=a4。scanf(%o,amp。運算。(2)設(shè)置一個低4位全為1,其余全為0的數(shù)。}【程序54】題目:取一個整數(shù)a從右端開始的4~7位。printf(\40: The a amp。 b(decimal) is %d \n,b)。b=a^3。 1^1=0:include main(){int a,b。 0^1=1。}【程序53】題目:學(xué)習(xí)使用按位異或 ^ 。printf(\40: The a amp。 b(decimal) is %d \n,b)。b=a|3。 1|1=1 ?。篿nclude main(){int a,b。 0|1=1。}【程序52】題目:學(xué)習(xí)使用按位或 | 。printf(\40: The a amp。bamp。printf(\40: The a amp。b=aamp。1=1:include main(){int a,b。0=0。1=0。0=0。 。}else if(i SMA j)printf(\40:%d smaller than %d \n,i,j)。if(i LAG j)printf(\40: %d larger than %d \n,i,j)。endif}【程序50】題目:include 的應(yīng)用練習(xí) :: 文件如下:define LAG define SMA define EQ ==include /*,*/include void main(){ int i=10。endifdefine MINifndef MINprintf(\40: The lower one is %d\n,MINIMUM(a,b))。endifundef MAXifdef MAXprintf(\40: The larger one is %d\n,MAXIMUM(a,b))。endififndef MINprintf(\40: The lower one is %d\n,MINIMUM(a,b))。ifdef MAXprintf(\40: The larger one is %d\n,MAXIMUM(a,b))。}【程序49】題目:if ifdef和ifndef的綜合應(yīng)用。else if(i SMA j)printf(\40:%d smaller than %d \n,i,j)。if(i LAG j)printf(\40: %d larger than %d \n,i,j)。}【程序48】題目:宏define命令練習(xí)(3) ::define LAG define SMA define EQ ==include void main(){ int i=10。printf(x=%d。 y=%d\n,x,y)。int y=20。\ b=t。\ t=a。else again=FALSE。printf(\40:The square for this number is %d \n,SQ(num))。scanf(%d,amp。printf(\40: Program will stop if input value less than 50.\n)。}【程序46】題目:宏define命令練習(xí)(1) ::include define TRUE 1define FALSE 0define SQ(x) (x)*(x)void main(){int num。i++)tmp+=i。for(i=1。::void main(){register int i。printf(The value of c is equal to %d\n,c)。}void main(){ a=b=4。a=3。::include int a,b,c。num++。{static int num=1。i++){printf(\40: The num equal %d \n,num)。for(i=0?! 。海篿nclude main(){int i,num?! ?num++?! ?{ auto int num=1。i++) { printf(\40: The num equal %d \n,num)?!?for (i=0。}【程序42】 題目:學(xué)習(xí)使用auto定義變量的用法: ?。篿nclude main(){int i,num。i3。}void main(){int i。var++。printf(\40:static var equa