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

正文內(nèi)容

c語言考試習(xí)題-資料下載頁

2025-09-25 16:27本頁面
  

【正文】 6 編程題 試題程序 請編一個(gè)函數(shù) void fun(int tt[M][N], int pp[N]), tt指向一個(gè) M行 N列的二維數(shù)組 , 求出二維數(shù)組每列中最大元素 , 并依次放入 pp所指的一維數(shù)組中 。 二維數(shù)組中的數(shù)已在主函數(shù)中給出 。 注意: 部分源程序給出如下 。 請勿改動(dòng)主函數(shù) main和其他函數(shù)中的任何內(nèi)容,僅在函數(shù) fun的花括號(hào)中填入所編寫的若干語句。 include include include define M 3 define N 4 void fun(int tt[M][N],int pp[N]) { } void main() {int t[M][N]={{68, 32, 54, 12},{14, 24, 88, 58},{42, 22, 44, 56}}。 int p[N],i,j,k。 system(CLS)。 printf(The riginal data is:\n)。 for(i=0。iM。i++) {for(j=0。jN。j++) printf(%6d,t[i][j])。 printf(\n)。 } fun(t,p)。 printf(\nThe result is:\n)。 for(k=0。kN。k++) printf(%4d,p[k])。 printf(\n)。} 題 干 試 題 答 案 例題 16試題程序 例題 17 編程題 試題程序 請編寫 函數(shù) fun(), 對長度為 7個(gè)字符的字符串 , 除首 、尾字符外 , 將其余 5個(gè)字符按 ASCII值碼升序排列 。 例如:原來的字符串為 BdsihAd, 則排序后輸出為BAdhisd。 注意: 部分源程序給出如下 。 請勿改動(dòng)主函數(shù) main和其他函數(shù)中的任何內(nèi)容,僅在函數(shù) fun的花括號(hào)中填入所編寫的若干語句。 include include include include int fun(char *s, int num) { } void main() { char s[10]。 system(CLS)。 printf(輸入 7個(gè)字符的字符串 :)。 gets(s)。 fun(s,7)。 printf(\n%s,s)。 } 題 干 試 題 答 案 例題 17試題程序 例題 18 編程題 試題程序 編寫 函數(shù) fun(), 它的功能是求 n以內(nèi) (不包括 n)同時(shí)能被5與 11整除的所有自然數(shù)之和的平方根 s, 并作為函數(shù)值返回 。 例如: n為 1000時(shí) , 函數(shù)值應(yīng)為 s=。 注意: 部分源程序給出如下 。 請勿改動(dòng)主函數(shù) main和其他函數(shù)中的任何內(nèi)容,僅在函數(shù) fun的花括號(hào)中填入所編寫的若干語句。 include include include include double fun(int n) { } void main() { system(CLS)。 printf(s=%f\n, fun(1000))。 } 題 干 試 題 答 案 例題 18試題程序 例題 19 編程題 試題程序 請編寫 函數(shù) fun(), 它的功能是求 Fibonacci數(shù)列中小于 t的最大的一個(gè)數(shù) , 結(jié)果由函數(shù)返回 。 其中 Fibonacci數(shù)列 F(n)的定義為 例如: t=1000時(shí) , 函數(shù)值為 987。 注意: 部分源程序給出如下 。 請勿改動(dòng)主函數(shù) main和其他函數(shù)中的任何內(nèi)容,僅在函數(shù) fun的花括號(hào)中填入所編寫的若干語句。 ?????????????11)1(,0)0(2)2()1()(nFFnnFnFnFinclude include include include int fun(int t) { } void main() { int n。 system(CLS)。 n=1000。 printf(n=%d, f=%d\n,n, fun(n))。 } 題 干 試 題 答 案 例題 19試題程序 例題 20 編程題 試題程序 請編寫一個(gè) 函數(shù) fun(), 它的功能是計(jì)算并輸出給定整數(shù) n的所有因子 (不包括 1與自身 )的平方和 ( 規(guī)定 n的值不大于 100) 。 例如:主函數(shù)從鍵盤給輸入 n的值為 56, 則輸出為sum=1113。 注意: 部分源程序給出如下 。 請勿改動(dòng)主函數(shù) main和其他函數(shù)中的任何內(nèi)容,僅在函數(shù) fun的花括號(hào)中填入所編寫的若干語句。 include long fun(int n) { } void main() { int n。 long sum。 printf(Input n:)。 scanf(%d, amp。n)。 sum=fun(n)。 printf(sum=%ld\n, sum)。 } 題 干 試 題 答 案 例題 20試題程序
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1