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

正文內(nèi)容

[電腦基礎(chǔ)知識]c語言二級考試試題-資料下載頁

2025-01-09 01:23本頁面
  

【正文】 9 7 8 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include define N 4 void fun(int (*t)[N]) { int i, j, x。 /**********found**********/ for(i=0。 i___1___。 i++) { /**********found**********/ x=t[i][___2___] 。 for(j=N1。 j=1。 j) t[i][j]=t[i][j1]。 /**********found**********/ t[i][___3___]=x。 } } main() { int t[][N]={21,12,13,24,25,16,47,38,29,11,32,54,42,21,33,10}, i, j。 printf(The original array:\n)。 for(i=0。 iN。 i++) { for(j=0。 jN。 j++) printf(%2d ,t[i][j])。 printf(\n)。 } fun(t)。 printf(\nThe result is:\n)。 for(i=0。 iN。 i++) { for(j=0。 jN。 j++) printf(%2d ,t[i][j])。 printf(\n)。 } } 2給定程序中,函數(shù) fun的功能是根據(jù)形參 i的值返回某個函數(shù)的值。當(dāng)調(diào)用正確時 , 程序輸出: x1=, x2=, x1*x1+x1*x2= 請在程序的下劃線處填 入正確的內(nèi)容并把下劃線刪除 , 使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include double f1(double x) { return x*x。 } double f2(double x, double y) { return x*y。 } /**********found**********/ __1__ fun(int i, double x, double y) { if (i==1) /**********found**********/ return __2__(x)。 else /**********found**********/ return __3__(x, y)。 } main() { double x1=5, x2=3, r。 r = fun(1, x1, x2)。 r += fun(2, x1, x2)。 printf(\nx1=%f, x2=%f, x1*x1+x1*x2=%f\n\n,x1, x2, r)。 } 2給定程序的主函數(shù)中,已給出由結(jié)構(gòu)體構(gòu)成的鏈表結(jié)點 a、 b、 c,各結(jié)點的數(shù)據(jù)域中均存入字符,函數(shù) fun()的作用是:將 a、 b、 c 三個結(jié)點鏈接成一個單向鏈表,并輸出鏈表結(jié)點中的數(shù)據(jù)。 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include typedef struct list { char data。 struct list *next。 } Q。 void fun( Q *pa, Q *pb, Q *pc) { Q *p。 /**********found**********/ panext=___1___。 pbnext=pc。 p=pa。 while( p ) { /**********found**********/ printf( %c,____2_____)。 /**********found**********/ p=____3____。 } printf(\n)。 } main() { Q a, b, c。 =39。E39。 =39。F39。 =39。G39。 =NULL。 fun( amp。a, amp。b, amp。c )。 } 2給定程序中,函數(shù) fun 的功能是:對形參 ss 所指字符串?dāng)?shù)組中的 M 個字符串按長度由短到長進(jìn)行排序。 ss 所指字符串?dāng)?shù)組中共有 M 個字符串,且串長 N。 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include include define M 5 define N 20 void fun(char (*ss)[N]) { int i, j, k, n[M]。 char t[N]。 for(i=0。 iM。 i++) n[i]=strlen(ss[i])。 for(i=0。 iM1。 i++) { k=i。 /**********found**********/ for(j=___1___。 jM。 j++) /**********found**********/ if(n[k]n[j]) ___2___。 if(k!=i) { strcpy(t,ss[i])。 strcpy(ss[i],ss[k])。 /**********found**********/ strcpy(ss[k],___3___)。 n[k]=n[i]。 } } } main() { char ss[M][N]={shanghai,guangzhou,beijing,tianjing,cchongqing}。 int i。 printf(\nThe original strings are :\n)。 for(i=0。 iM。 i++) printf(%s\n,ss[i])。 printf(\n)。 fun(ss)。 printf(\nThe result :\n)。 for(i=0。 iM。 i++) printf(%s\n,ss[i])。 } 給定程序中,函數(shù) fun 的作用是:統(tǒng)計整型變量 m 中各數(shù)字出現(xiàn)的次數(shù), 并存放到數(shù)組 a中,其中: a[0]存放 0出現(xiàn)的次數(shù), a[1]存放 1出現(xiàn)的次數(shù),?? a[9]存放 9出現(xiàn)的次數(shù)。 例如,若 m為 14579233,則輸出結(jié)果應(yīng)為: 0,1,1,2,1,1,0,1,0,1, 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include void fun( int m, int a[10]) { int i。 for (i=0。 i10。 i++) /**********found**********/ __1__ = 0。 while (m 0) { /**********found**********/ i = ___2___。 a[i]++。 /**********found**********/ m = ___3___。 } } main() { int m, a[10],i。 printf(請輸入一個整數(shù) : )。 scanf(%d, amp。m)。 fun(m, a)。 for (i=0。 i10。 i++) printf(%d,a[i])。 printf(\n)。 } 3給定程序中,函數(shù) fun的功能是:在形參 s所指字符串中的每個數(shù)字字符之后插入一個 *號。例如,形參 s 所指的字符串為: def35adh3kjsdf7。執(zhí)行結(jié)果為: def3*5*adh3*kjsdf7*。 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:源程 序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include void fun(char *s) { int i, j, n。 for(i=0。 s[i]!=39。\039。 i++) /**********found**********/ if(s[i]=39。039。 ___1___ s[i]=39。939。) { n=0。 /**********found**********/ while(s[i+1+n]!= ___2___) n++。 for(j=i+n+1。 ji。 j) /**********found**********/ s[j+1]= ___3___。 s[j+1]=39。*39。 i=i+1。 } } main() { char s[80]=ba3a54cd23a。 printf(\nThe original string is : %s\n,s)。 fun(s)。 printf(\nThe result is : %s\n,s)。 } 3函數(shù) fun的功能是:輸出 a所指數(shù)組中的前 n個數(shù)據(jù),要求每行輸出 5個數(shù)。 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include include void fun( int *a, int n ) { int i。 for(i=0。 in。 i++) { /**********found**********/ if( ___1___==0 ) /**********found**********/ printf(___2___)。 /**********found**********/ printf(%d ,___3___)。 } } main() { int a[100]={0}, i,n。 n=22。 for(i=0。 in。i++) a[i]=rand()%21。 fun( a, n)。 printf(\n)。 } 3給定程序中,函數(shù) fun 的功能是:調(diào)用隨機函數(shù)產(chǎn)生 20 個互不相同的整數(shù)放在形參 a所指數(shù)組中(此數(shù)組在主函數(shù)中已置 0)。 請在程序的下劃線處填入正確的內(nèi)容并把下劃線刪除 , 使程序得出正確的結(jié)果。 注意:源程序存放在考生文件夾下的 。 不得增行或刪行,也不得更改程序的結(jié)構(gòu)! include include define N 20 void fun( int *a) { int i, x, n=0。 x=rand()%20。 /**********found**********/ while (n__1__) { for(i=0。 in。 i++ ) /**********found**********/ if( x==a[i] ) __2__。 /**********found**********/ if( i==__3__){ a[n]=x。 n++。 } x=rand()%20。 } } main() { int x[N]={0} ,i。 fun( x )。 printf(The result : \n)。 for( i=0。 iN。 i++ ) { printf
點擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1