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

正文內(nèi)容

歷年全國計算機等級考試-二級c語言上機考試題庫(附答案)(編輯修改稿)

2025-07-20 03:24 本頁面
 

【文章內(nèi)容簡介】 for (i=0。 iN。 i++)/**********found**********/ if( strcmp(___2___,num)==0 )/**********found**********/ return (___3___)。 return a。}修改:從s所指字符串中,找出與t所指字符串相同的字串的個數(shù)作為函數(shù)返回值例如,當s所指字符串中的內(nèi)容為:“abcdabfab”,t所指字符串的內(nèi)容為:“ab”則函數(shù)返回整數(shù)3int fun (char *s, char *t){ int n。 char *p , *r。 n = 0。 while ( *s ) { p = s。 r = t。 while ( *r ) if ( *r == *p ) {/************found************/ r++。 p++ } else break。/************found************/ if ( r == 39。\039。 ) n++。 s++。 } return n。}函數(shù)fun的功能是:將s所指字符串中ASCII值為偶數(shù)的字符刪除,串中剩余字符形成一個新串放在t所指的數(shù)組中例如,若s所指字符串中的內(nèi)容為“ABCDEFG12345”,其中字符B的ASCII碼值為偶數(shù)…..答案:1B: STU std[i].num std[i] M: p++。 *r==’\0’ 。P: int i, j = 0 。 for(i = 0 。 i strlen(s)。 i++) if(s[i] % 2) t[j++] = s[i] 。 t[j] = 0 。12.填空人員的記錄由編號和出生年月日組成N名成員的數(shù)據(jù)已在主函數(shù)中存入結(jié)構(gòu)體數(shù)組std中,函數(shù)fun的功能是:找出指定出生年份的人員,將其數(shù)據(jù)放在形參k所指的數(shù)組中,由主函數(shù)輸出,同事有函數(shù)值返回滿足指定條件的人數(shù)int fun(STU *std, STU *k, int year){ int i,n=0。 for (i=0。 iN。 i++)/**********found**********/ if( ___1___==year)/**********found**********/ k[n++]= ___2___。/**********found**********/ return (___3___)。}修改給定程序MODI12。C的功能是:讀入一個整數(shù)k(2《k《1000),打印她的所有因子例如2310,則應輸出2,3,5,7,11/************found************/IsPrime ( int n )。{ int i, m。 m = 1。 for ( i = 2。 i n。 i++ )/************found************/ if !( n%i ) { m = 0。 break 。 } return ( m )。}設(shè)計已知學生的記錄有學號成績構(gòu)成,N名學生的數(shù)據(jù)已經(jīng)存入結(jié)構(gòu)體數(shù)組a中。編寫函數(shù)fun,函數(shù)功能是:找出成績最高的學生記錄,通過形參指針傳回主函數(shù)(規(guī)定只有一個最高分)。已給出函數(shù)的首部,請完成該函數(shù)1B: std[i].year std[i] n M: 分號去掉 if (!( n%i )) P: int i, max = a[0].s, j = 0。 for(i = 1 。 i N 。 i++) if(max a[i].s) { j = i 。 max = a[i].s 。 } *s = a[j] 。 13.填空給定程序通過定義并賦初值的方式,利用結(jié)構(gòu)體變量存儲了一名學生的學號,姓名和3們課程的成績,函數(shù)fun的功能是將該學生的各科成績都乘以一個系數(shù)avoid show(STU tt){ int i。 printf(%d %s : ,)。 for(i=0。 i3。 i++) printf(%,[i])。 printf(\n)。}/**********found**********/void modify(___1___ *ss,float a){ int i。 for(i=0。 i3。 i++)/**********found**********/ ss___2___ *=a。}main( ){ STU std={ 1,Zhanghua, }。 float a。 printf(\nThe original number and name and scores :\n)。 show(std)。 printf(\nInput a number : )。 scanf(%f,amp。a)。/**********found**********/ modify(___3___,a)。 printf(\nA result of modifying :\n)。 show(std)。}修改給定程序MODI。C中函數(shù)fun的功能是:求k!(k13),所求階乘的值作為函數(shù)值返回,例如若(k=10,則應輸出:3628800long fun ( int k){/************found************/ if k 0 return (k*fun(k1))。/************found************/ else if ( k=0 ) return 1L。}設(shè)計程序定義了N*N的二維數(shù)組。并在主函數(shù)中自動賦值,請編寫函數(shù)fun,函數(shù)的功能是:使數(shù)組左下三角元素的值乘以n例如:若n的值為3,a數(shù)組的值為1B: STU score[i] amp。std M: ( ) k= =0 P: int i, j。 for(i = 0 。 i N 。 i++) for(j = 0 。 j = i。 j++) a[i][j] *= n 。給定程序中,函數(shù)fun的功能是:將形參所指結(jié)構(gòu)體數(shù)組中的三個元素按num成員進行升序排列/**********found**********/void fun(PERSON ___1___){/**********found**********/ ___2___ temp。 if(std[0].numstd[1].num) { temp=std[0]。 std[0]=std[1]。 std[1]=temp。 } if(std[0].numstd[2].num) { temp=std[0]。 std[0]=std[2]。 std[2]=temp。 } if(std[1].numstd[2].num) { temp=std[1]。 std[1]=std[2]。 std[2]=temp。 }}main(){ PERSON std[ ]={ 5,Zhanghu,2,WangLi,6,LinMin }。 int i。/**********found**********/ fun(___3___)。 printf(\nThe result is :\n)。 for(i=0。 i3。 i++) printf(%d,%s\n,std[i].num,std[i].name)。}修改:將m個字符串連接起來組成一個新串,放入pt所指存儲區(qū)中int fun ( char str[][10], int m, char *pt ){/************found************/ Int k, q, i 。 for ( k = 0。 k m。 k++ ) { q = strlen ( str [k] )。 for (i=0。 iq。 i++)/************found************/ pt[i] = str[k,i] 。 pt += q 。 pt[0] = 0 。 }}設(shè)計程序定義了N*N的二維數(shù)組, 并在主函數(shù)中自動賦值,請編寫函數(shù)fun,函數(shù)的功能是:使數(shù)組左下三角元素中的值全部值01B: *std PERSON std M: int str[k][i] P: int i, j。 for(i = 0 。 i N 。 i++) for(j = 0 。 j = i。 j++) a[i][j] =0。給定程序中,函數(shù)fun的功能是:將形參std所指結(jié)構(gòu)體數(shù)組中年齡最大者的數(shù)據(jù)作為函數(shù)值返回,并在主函數(shù)中輸出STD fun(STD std[], int n){ STD max。 int i。/**********found**********/ max= ___1___。 for(i=1。 in。 i++)/**********found**********/ if(___2___) max=std[i]。 return max。}main( ){ STD std[5]={aaa,17,bbb,16,ccc,18,ddd,17,eee,15 }。 STD max。 max=fun(std,5)。 printf(\nThe result: \n)。/**********found**********/ printf(\nName : %s, Age : %d\n, ___3___,)。}修改:實現(xiàn)兩個整數(shù)的交換例如給a和b分別輸入60和65,輸出為:a=65 b=60/**********found**********/void fun ( int a, b ){ int t。/**********found**********/ t = b。 b = a 。 a = t。}設(shè)計請編制一個函數(shù)fun,tt指向一個M行N列的二維數(shù)組,求二維數(shù)組每列中最小元素,并以此放入pp所指一維數(shù)組中。二維數(shù)組中的數(shù)已在主函數(shù)中賦予1B: *std std[i].age M: int *b t = *b。 *b = *a 。 *a = t。 P: int i,j, min, k 。 for(i = 0 。 i N 。 i++) { min = tt[0][i] 。 k = 0 。 for(j = 1 。 j M 。 j++) if(min tt[j][i]) { min=tt[j][i] 。 k = j 。 } pp[i] = tt[k][i] 。 }程序通過定義并賦初值的方式,利用結(jié)構(gòu)體變量存儲了一名學生的信息,函數(shù)fun的功能是輸出這位學生的信息/**********found**********/void show(STU ___1___){ int i。 printf(\n%d %s %c %d%d%d, , , , , , )。 for(i=0。 i3。 i++)/**********found**********/ printf(%, ___2___)。 printf(\n)。}main( ){ STU std={ 1,Zhanghua,39。M39。,1961,10,8, }。 printf(\nA student data:\n)。/**********found**********/ show(___3___)。}修改:求出數(shù)組中最大數(shù)和次大數(shù),并把最大數(shù)和a【0】中的數(shù)對調(diào),次最大數(shù)和a【1】中的書對調(diào)int fun ( int * a, int n ){ int i, m, t, k 。 for(i=0。i2。i++) {/**********found**********/ m=0。 for(k=i+1。kn。k++)/**********found**********/ if(a[k]a[m]) k=m。 t=a[i]。a[i]=a[m]。a[m]=t。 }}設(shè)計請編寫一個函數(shù)unsigned fun ,w是一個大與10的無符號整數(shù),若w是n為的整數(shù),函數(shù)求出w的低n1位的數(shù)作為函數(shù)值返回例如 w為5923 則函數(shù)返回923;1B: tt [i] std M: m=i m=k P: if(w10000) w %= 10000 。 else if(w1000) w %= 1000 。 else if(w100) w %= 100 。 else if(w10) w %=10 。 return w 。 給定程序中,函數(shù)fun的功能是:對形參ss所指字符串數(shù)組
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1