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

正文內(nèi)容

c語言程序設(shè)計(jì)學(xué)習(xí)手冊(編輯修改稿)

2025-07-09 12:31 本頁面
 

【文章內(nèi)容簡介】 序流程 3. 理解 for 語句的使用規(guī)則和相應(yīng)程序流程 4. 熟練應(yīng)用各種循環(huán)語句 的組合使用 5. 理解 break、 continue 語句的使用特性以及應(yīng)用范疇 6. 了解 goto 語句的使用方法 17 二、學(xué)習(xí)重點(diǎn): 各種循環(huán)語句的組合使用 break、 continue 語句的使用特性 三、學(xué)習(xí)難點(diǎn): for語句的循環(huán)嵌套 四、課堂筆記: _____________________________________________________________________________________ _____________________________________________________________________________________ _____________________________________________________________________________________ 五、上機(jī)試驗(yàn): 1. 求 1+2+? ? +100 的結(jié)果。 include void main() { int sum,counter。 sum=0。 counter=1。 do { sum=sum+counter。 counter=counter+1。 } while (counter=100)。 printf(1+2+3+… ...+100=%d \n,counter)。 } 2. 將下列程序段分別用 C語言的 for、 while、 do…while 結(jié)構(gòu)改寫,使其能產(chǎn)生相同的運(yùn)行結(jié)果: int nX=1。 abc: printf(“nX=%d\n”,nX)。 nX++。 if(nX5) goto abc。 3. 寫出下列程序的輸出結(jié) 果: 18 include void main() { int nX,nY。 for(nY=0,nX=1。nX4。nX++) { if(nY==2){ nX = nY。 continue。 } switch(nX){ case 1: printf(“x=%d”,nX)。 continue。 case 2: printf(“x+y=%d”,nX+nY)。 break。 case 3: printf(“x*y=%d”,nX*nY)。 continue。 case 4: printf(“xy=%d”,nXnY)。 break。 } printf(“y=%d”,++nY)。 } } 4. 上機(jī)寫出如下程序段的輸出結(jié)果: int nX = 1, nY = 0。 do{ while(nX == 0){ printf(“y = %d\n”, nY)。 nY++。 if(nY 3) break。 } printf(“x = %d\n”,nX)。 if(nY == 4) continue。 nX 。 }while(!nX)。 5. 統(tǒng)計(jì)各個數(shù)字、空白符及其他字符出現(xiàn)的次數(shù) include void main() { int nCh, nI, nWhite,nNother。 int nDigit[10]。 //變量 nDigit 聲明為有 10 個整形數(shù)構(gòu)成的數(shù)組 nWhite= nNother=0。 for(nI=0。nI10。++nI) nDigit[nI]=0。 while((nCh = getchar())!= EOF) 19 if(nCh=?0?amp。amp。nCh=?9?) ++nDigit[nCh?0?]。 else if (nCh= =? ?||nCh==?\n?|| nCh==?\t?) ++nWhite。 else ++nNother。 printf(“Digits = ”)。 for(nI=0。nI10。++nI) printf(“%d”,nDigit[i])。 printf(“,white space=%d,other=%d\n”,nWhite,nNother)。 } 6. 輸出下列圖形: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 include void main() { int m,n。 for (n=1。n=9。n=n+1) { for (m=1。m=n。m=m+1) printf(%4d,m)。 printf(\n)。 /*一行結(jié)束需要換行 */ } 20 } 7. 輸出 3~100的所有素?cái)?shù)。 include void main() { int nNum,nI。 for (nNum=3。nNum=100。nNum=nNum+1) {for (nI=2。nI=nNum1。nI=nI+1) if (nNum % nI==0) break。 if (nI=nNum) printf(%d\t,nNum)。 } } 六、作業(yè) : break 語句和 continue 語句的區(qū)別。 答案: _________________________________________________________________________________ Fibonacci數(shù)列的前 30 項(xiàng),并輸出。 。如果一個三位數(shù)的百位數(shù)、十位數(shù)和個位數(shù)的立方和等于這個數(shù)則該數(shù)為水仙花數(shù)。 ,求出這個數(shù)的階乘( 10 的階乘即為 10*9*8*…*2*1 ) ,在屏幕上輸出如下圖形: * *** ***** ******* ********* ,計(jì)算公式的值: 1/1 + 2/(1+2) + 3/(1+2+3) + … + 10/(1+2+3+… +10) 七、經(jīng)驗(yàn)積累 序號 問 題 描 述 經(jīng)驗(yàn)級別 21 1 ? ? ? 2 ? ? ? 3 ? ? ? 4 ? ? ? 5 ? ? ? 6 ? ? ? 7 ? ? ? 8 ? ? ? 9 ? ? ? 10 ? ? ? 第五講:數(shù) 組 一、學(xué)習(xí)目標(biāo): ? 熟悉一維數(shù)組的定義和初始化 ? 理解一維數(shù)組的存儲方式 ? 熟悉一維數(shù)組的引用 ? 熟悉二維數(shù)組的定義和初始化 ? 理解二維數(shù)組的存儲方式 ? 熟悉二維數(shù)組的引用 ? 熟練應(yīng)用數(shù)組作為函數(shù)參數(shù)時的傳參方式:數(shù)組元素作參數(shù);數(shù)組名作參數(shù) 二、學(xué)習(xí)重點(diǎn): ? 一維數(shù)組的定義和初始化 ? 二維數(shù)組的定義和初始化 ? 二維數(shù)組的存儲方式 ? 函數(shù)參數(shù)時的傳參方式:數(shù)組名作參數(shù) 22 三、學(xué)習(xí)難點(diǎn): 二維數(shù)組的存儲方式 函數(shù)參數(shù)時的傳參方式:數(shù)組名作參數(shù) 四、課堂筆記: _____________________________________________________________________________________ _____________________________________________________________________________________ _____________________________________________________________________________________ 五、上機(jī)試驗(yàn): 1. 將數(shù)字 0~4 放入 一個整型數(shù)組,并逆序輸出數(shù)組。 include void main() { int i,a[5]。 /*給數(shù)組中元素賦值 */ for (i=0。i5。i++) a[i]=i。 /*逆序輸出數(shù)組中元素值 */ for (i=4。i=0。i) printf (%3d,a[i])。 printf(\n)。 } 2. 輸入 10 個整數(shù),輸出最大數(shù)。 include void main() { int i,array[10],big。 /*給數(shù)組中所有元素賦值 */ for(i=0。i10。i++) scanf(%d,amp。array[i])。 /*找出數(shù)組中最大的元素 */ big=array[0]。 for(i=0。i10。i++) if(array[i]big) big=array[i]。 printf (The biggest is %3d\n,big)。 } Fibonacci數(shù)列的前 20項(xiàng) 。 23 include void main( ) { int i , f[20]={1,1}。 /*給出 Fibonacci數(shù)列的前 2項(xiàng) */ /*根據(jù)公式由 Fibonacci數(shù)列前 2項(xiàng)求出其余 18 項(xiàng) */ for(i=2。i20。i++) f[i]=f[i1]+f[i2]。 /*輸出 Fibonacci數(shù)列的前 20項(xiàng) */ for(i=0。i20。i++) { if (i%5==0) printf(\n)。 /*控制一行輸出 5個元素 */ printf(%10d,f[i])。 } } 4. 已知一個一維數(shù)組 a[11]中有 10個數(shù),求出其中前 n個數(shù)的和。其中 n由鍵盤輸入 。 include int sum(int nArray[ ],int n) { int i,sum=0。 for (i=0。in。i++) sum+=nArray[i]。 return sum。 } void main() { int nNum, a[10]={1,2,3,4,5,6,7,8,9,10}。 scanf (%d,amp。nNum)。 printf(%d\n,sum(a,nNum))。 } include 24 void main() { int a[3][4]={{1,2,3,4}, {9,8,7,6}, {10,10,5,2}}。 int i,j,row=0,colum=0,max。 max=a[0][0]。 for(i=0。i=2。i++) for(j=0。j=3。j++) if(a[i][j]max) { max=a[i][j]。 row=i。 colum=j。 } printf(max=%d,row=%d, \ colum=%d\n,max,row,colum)。 } 六、上機(jī)作業(yè): 1. 如下代碼有錯嗎?如果有錯,錯在哪里?如果正確,寫出數(shù) 組中所有元素的值: int a[5]={1,2,3,4,5,6}。 int b[2+3]={1,2,3}。 int c[5]={ , , 3, 4}。 int d[3,3]={{1,2,3},{4,5,6},{7,8,9}}。 int e[2][3]={{1},{2},{3}}。 int f[3][2]={1,2,3}。 int g[2][3]={{ , ,2},{1,0,0}}。 答案: _________________________________________________________________________________ 2.用如下程序段對數(shù)組進(jìn)行賦值,行嗎?為什么? int a[5],b[5],c[5]i。 for(i=1。i=5。i++) a[i]=0。 25 b=a。 c={1,2,3,4,5}。 答案: _________________________________________________________________________________ 3.使如下程序能實(shí)現(xiàn)數(shù)組 Array 中所有元素前后互換: include void m
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1