freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

100個經(jīng)典c語言例題帶答案-資料下載頁

2025-06-24 06:42本頁面
  

【正文】 er,amp。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   ::include include include main(){int x=360,y=160,driver=VGA,mode=VGAHI。int num=20,i。int top,bottom。initgraph(amp。driver,amp。mode,)。top=y30。bottom=y30。for(i=0。inum。i++){ellipse(250,250,0,360,top,bottom)。top=5。bottom+=5。}getch()。}==============================================================【程序64】題目:利用ellipse and rectangle 畫圖。::include include include main(){int driver=VGA,mode=VGAHI。int i,num=15,top=50。int left=20,right=50。initgraph(amp。driver,amp。mode,)。for(i=0。inum。i++){ellipse(250,250,0,360,right,left)。ellipse(250,250,0,360,20,top)。rectangle(202*i,202*i,10*(i+2),10*(i+2))。right+=5。left+=5。top+=10。}getch()。}==============================================================【程序65】題目:一個最優(yōu)美的圖案。  ?。海篿nclude include include include include include include define MAXPTS 15define PI struct PTS {int x,y。}。double AspectRatio=。void LineToDemo(void){struct viewporttype vp。struct PTS points[MAXPTS]。int i, j, h, w, xcenter, ycenter。int radius, angle, step。double rads。printf( MoveTo / LineTo Demonstration )。getviewsettings( amp。vp )。h = 。w = 。xcenter = w / 2。 /* Determine the center of circle */ycenter = h / 2。radius = (h 30) / (AspectRatio * 2)。step = 360 / MAXPTS。 /* Determine of increments */angle = 0。 /* Begin at zero degrees */for( i=0 。 iMAXPTS 。 ++i ){ /* Determine circle intercepts */rads = (double)angle * PI / 。 /* Convert angle to radians */points[i].x = xcenter + (int)( cos(rads) * radius )。points[i].y = ycenter (int)( sin(rads) * radius * AspectRatio )。angle += step。 /* Move to next increment */}circle( xcenter, ycenter, radius )。 /* Draw bounding circle */ for( i=0 。 iMAXPTS 。 ++i ){ /* Draw the cords to the circle */for( j=i 。 jMAXPTS 。 ++j ){ /* For each remaining intersect */moveto(points[i].x, points[i].y)。 /* Move to beginning of cord */lineto(points[j].x, points[j].y)。 /* Draw the cord */} } }main(){int driver,mode。driver=CGA。mode=CGAC0。initgraph(amp。driver,amp。mode,)。setcolor(3)。setbkcolor(GREEN)。LineToDemo()。}==============================================================【程序66】題目:輸入3個數(shù)a,b,c,按大小順序輸出?!  。豪弥羔樂椒ā#?*pointer*/main(){int n1,n2,n3。int *pointer1,*pointer2,*pointer3。printf(please input 3 number:n1,n2,n3:)。scanf(%d,%d,%d,amp。n1,amp。n2,amp。n3)。pointer1=amp。n1。pointer2=amp。n2。pointer3=amp。n3。if(n1n2) swap(pointer1,pointer2)。if(n1n3) swap(pointer1,pointer3)。if(n2n3) swap(pointer2,pointer3)。printf(the sorted numbers are:%d,%d,%d\n,n1,n2,n3)。}swap(p1,p2)int *p1,*p2。{int p。p=*p1。*p1=*p2。*p2=p。}==============================================================【程序67】題目:輸入數(shù)組,最大的與第一個元素交換,最小的與最后一個元素交換,輸出數(shù)組。:譚浩強的書中答案有問題?!     。簃ain(){int number[10]。input(number)。max_min(number)。output(number)。}input(number)int number[10]。{int i。for(i=0。i9。i++) scanf(%d,amp。number[i])。 scanf(%d,amp。number[9])。}max_min(array)int array[10]。{int *max,*min,k,l。int *p,*arr_end。arr_end=array+10。max=min=array。for(p=array+1。parr_end。p++) if(*p*max) max=p?!lse if(*p*min) min=p?!=*max?!=*min?!?p=array[0]。array[0]=l。l=*p?!?p=array[9]。array[9]=k。k=*p?!eturn。}output(array)int array[10]。{ int *p。for(p=array。parray+9。p++) printf(%d,*p)。printf(%d\n,array[9])。}==============================================================【程序68】題目:有n個整數(shù),使其前面各數(shù)順序向后移m個位置,最后m個數(shù)變成最前面的m個數(shù)::main(){int number[20],n,m,i。printf(the total numbers is:)。scanf(%d,amp。n)。printf(back m:)。scanf(%d,amp。m)。for(i=0。in1。i++) scanf(%d,amp。number[i])。scanf(%d,amp。number[n1])。move(number,n,m)。for(i=0。in1。i++) printf(%d,number[i])。printf(%d,number[n1])。}move(array,n,m)int n,m,array[20]。{int *p,array_end。array_end=*(array+n1)。for(p=array+n1。parray。p) *p=*(p1)?!?array=array_end?!。 if(m0) move(array,n,m)。}==============================================================【程序69】題目:有n個人圍成一圈,順序排號。從第一個人開始報數(shù)(從1到3報數(shù)),凡報到3的人退出   圈子,問最后留下的是原來第幾號的那位。1. 程序分析::define nmax 50main(){int i,k,m,n,num[nmax],*p。printf(please input the total of numbers:)。scanf(%d,amp。n)。p=num。for(i=0。in。i++) *(p+i)=i+1。 i=0?!=0。 m=0。 while(mn1) { if(*(p+i)!=0) k++。 if(k==3) { *(p+i)=0。 k=0。 m++。 }i++。if(i==n) i=0。}while(*p==0) p++。printf(%d is left\n,*p)。}==============================================================【程序70】題目:寫一個函數(shù),求一個字符串的長度,在main函數(shù)中輸入字符串,并輸出其長度?!  。海簃ain(){int len。char *str[20]。printf(please input a string:\n)。scanf(%s,str)。len=length(str)。printf(the string has %d characters.,len)。}length(p)char *p。{int n。n=0。while(*p!=39。\039。){ n++。 p++。}return n。} 作者: zhlei81 2005122 11:32   回復(fù)此發(fā)言 14 回復(fù):經(jīng)典C源程序100例 【程序71】題目:編寫input()和output()函數(shù)輸入,輸出5個學(xué)生的數(shù)據(jù)記錄。::define N 5struct student{ char num[6]?!har name[8]?!nt score[4]。} stu[N]。input(stu)struct student stu[]。{ int i,j?!or(i=0。iN。i++) { printf(\n please input %d of %d\n,i+1,N)?! rintf(num: )?! canf(%s,stu[i].num)?! rintf(name: )?! canf(%s,stu[i].name)。   for(j=0。j3。j++)   { printf(score %d.,j+1)?!   canf(%d,amp。stu[i].score[j])?!    printf(\n)?!}print(stu)struct student stu[]。{ int i,j。printf(\nNo. Name Sco1 Sco2 Sco3\n)。for(i=0。iN。i++){ printf(%6s%10s,stu[i].num,stu[i].name)。 for(j=0。j3。j++)  printf(%8d,stu[i].score[j])。 print
點擊復(fù)制文檔內(nèi)容
數(shù)學(xué)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1