【正文】
scanf(%d。i++) scanf(%d,amp。for(i=0。}input(number)int number[10]。max_min(number)?! 。簃ain(){int number[10]。}==============================================================【程序67】題目:輸入數(shù)組,最大的與第一個(gè)元素交換,最小的與最后一個(gè)元素交換,輸出數(shù)組。*p1=*p2。{int p。printf(the sorted numbers are:%d,%d,%d\n,n1,n2,n3)。if(n1n3) swap(pointer1,pointer3)。n3。n2。n1。n3)。n1,amp。printf(please input 3 number:n1,n2,n3:)。:/*pointer*/main(){int n1,n2,n3。} ==============================================================【程序66】題目:輸入3個(gè)數(shù)a,b,c,按大小順序輸出。setbkcolor(green)。mode,)。initgraph(amp。driver=cga。 /* move to beginning of cord */lineto(points[j].x, points[j].y)。 ifor( j=i 。 /* move to next increment */}circle( xcenter, ycenter, radius )。points[i].y = ycenter (int)( sin(rads) * radius * aspectratio )。 irads = (double)angle * pi / 。 /* determine of increments */angle = 0。radius = (h 30) / (aspectratio * 2)。xcenter = w / 2。h = 。getviewsettings( amp。double rads。int i, j, h, w, xcenter, ycenter。void linetodemo(void){struct viewporttype vp。}。}==============================================================【程序65】題目:一個(gè)最優(yōu)美的圖案。top+=10。right+=5。ellipse(250,250,0,360,20,top)。for(i=0。driver,amp。int left=20,right=50。::include include include main(){int driver=vga,mode=vgahi。}getch()。top=5。for(i=0。top=y30。driver,amp。int top,bottom。}==============================================================【程序63】題目:畫橢圓ellipse ::include include include main(){int x=360,y=160,driver=vga,mode=vgahi。i=230。j=230。j++) putpixel(i,j,1)。i+=20) for(j=50。for(i=50。mode,)。initgraph(amp?!}==============================================================【程序62】題目:學(xué)習(xí)putpixel畫點(diǎn)。j++) printf(%5d,a[i][j])。i++) {for(j=0。for(i=0。i++) for(j=1。}for(i=2。i++) {a[i][0]=1。for(i=0。int a[10][10]。 }}closegraph()?!f(++countlines) { setcolor(color)?!f(x2=left||x2=right) dx2=dx2。 if(x1=left||x1=right) dx1=dx1?!2+=dx2?!1+=dx1。dx2=dy2=3。x1=x2=y1=y2=10。driver,amp。mode=vgahi。int color=0。int dx1,dy1,dx2,dy2,i=1。int x1,y1。}==============================================================【程序60】題目:畫圖,綜合例子?! ine(x0,y0,x,y)?! =ceil(x0+48*cos(a))。j=50。 line(x0,y0,x,y)?! =ceil(y0+48+sin(a)*b)。i++) { a=(2*pai/16)*i+(2*pai/180)*k?!or(i=0。k=500。getch()。setfillstyle(hatch_fill,yellow)。outtextxy(10,170,press a key)。circle(x0,y0,60)。 line(x0,y0,x,y)?!=ceil(y0+48*sin(a)*b)。i++){ a=(2*pai/16)*i。for(i=0。circle(x0,y0,20)。y0=100。setbkcolor(green)。mode,)。initgraph(amp。driver=cga。:: define pai define b include include main(){int i,j,k,x0,y0,x,y,driver,mode。circle(269,269,137)。line(130,60,480,60)。}settextstyle(default_font,horiz_dir,2)。x1=x1+5。x0=x05。i++){setcolor(1)。for(i=0。y1=275。x0=263。mode,)。initgraph(amp。driver=vga?! 。豪胒or循環(huán)控制100999個(gè)數(shù),每個(gè)數(shù)分解出個(gè)位,十位,百位。y1=y15。x0=x0+5。i++){setcolor(5)。for(i=0。y1=275。j=j+10。x1=x1+5。x0=x05。i++){setcolor(5)。for(i=0。y1=275。x0=263。mode,)。initgraph(amp。driver=vga。float x0,y0,y1,x1。}} ==============================================================【程序57】題目:畫圖,學(xué)用line畫直線。k=k+j。i++){setcolor(8)。for(i=0。mode,)。initgraph(amp。driver=vga。 ?。海?*circle*/include main(){int driver,mode,i。s 1 plement(hexidecimal) is %x \n,a)。a=~a。printf(\40: the a39。a=234。 ~1=0。}==============================================================【程序55】題目:學(xué)習(xí)使用按位取反~。c。c=~(~04)。a)。:main(){unsigned a,b,c,d??捎脋(~04)(3)將上面二者進(jìn)行amp。程序分析:可以這樣考慮: (1)先使a右移4位。 b(decimal) is %d \n,b)。b^=7。printf(\40: the a amp。a=077。 1^0=1?! 。?^0=0。 b(decimal) is %d \n,b)。b|=7。printf(\40: the a amp。a=077。 1|0=1。:0|0=0。 b(decimal) is %d \n,b)。=7。 b(decimal) is %d \n,b)。3。a=077。 1amp。 1amp。 0amp。 ?。?amp。}程序51】題目:學(xué)習(xí)使用按位與 amp。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) ?。海篸efine 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) ?。海篿nclude 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)?!or (i=0。}==============================================================【程序42】 題目:學(xué)習(xí)使用auto定義變量的用法: ?。篿nclude main(){int i,num。i3。