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

正文內(nèi)容

c語(yǔ)言期末復(fù)習(xí)題(已改無(wú)錯(cuò)字)

2023-07-08 13:33:09 本頁(yè)面
  

【正文】 or (i=0。 iN。 i++) printf(%4d , b[i])。 printf(\n)。 fun(b, N)。 printf(\nThe data after moving :\n)。 for (i=0。 iN。 i++) printf(%4d , b[i])。 printf(\n)。}// :/**********found**********/ p = (n%2==0)?n/2:n/2+1。/**********found**********/ a[i] = a[p+i]。/**********found**********/ a[p+i] = t。3給定程序的功能是把s串中所有的字符前移一個(gè)位置,串中的第一個(gè)字符移到最后。 例如:s串中原有的字符串為:,則調(diào)用該函數(shù)后,s串中的內(nèi)容為:。 請(qǐng)?jiān)诔绦虻南聞澗€處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:。不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include define N 81fun ( char *s ){ char b[N] 。 sprintf(b, %s%c, s + 1, *s) 。/**************found**************/ strcpy(___1___) 。}main( ){ char a[ N ] 。 printf ( Enter a string : )。 gets ( a )。 printf ( The original string is : )。 puts( a )。/**************found**************/ fun ( ___2___ )。 printf ( The string after modified : )。/**************found**************/ ___3___ ( a )。}// :/**************found**************/ strcpy(s, b) 。/**************found**************/ fun ( a )。/**************found**************/ puts ( a )。給定程序的功能是計(jì)算并輸出high以內(nèi)最大的10個(gè)素?cái)?shù)之和。high函數(shù)由主函數(shù)傳給fun函數(shù)。若high的值為100,則函數(shù)的值為732。 請(qǐng)?jiān)诔绦虻南聞澗€處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確的結(jié)果。 注意:。不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include include int fun( int high ){ int sum = 0, n=0, j, yes。/************found************/ while ((high = 2) ___1___ (n 10)) { yes = 1。 for (j=2。 j=high/2。 j++ ) if (high % j ==0 ){/************found************/ yes=0。 ___2___。 } if (yes) { sum +=high。 n++。 }/************found************/ ___3___。 } return sum 。}main ( ){ printf(%d\n, fun (100))。}// :/************found************/ while ((high = 2) amp。amp。 (n 10))/************found************/ yes=0。 break。/************found************/ high。4給定程序的功能是根據(jù)公式求P的值,結(jié)果由函數(shù)值帶回。m與n為兩個(gè)整數(shù)且要求mn。 m! P = ───── n!(mn)! 例如:m=11,n=4時(shí)。 請(qǐng)?jiān)诔绦虻南聞澗€處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確結(jié)果。 注意:。不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include long jc(int m){ long s=1。 int i 。/**************found**************/ for(i=1。i=m。i++) s=___1___ 。 return s。}float fun(int m, int n){ float p。/**************found**************/ p=*jc(m)/jc(n)/jc(___2___) 。/**************found**************/ ___3___。}main(){ printf(P=%f\n, fun (11,4))。}// :/**************found**************/ for(i=1。i=m。i++) s=s*i 。 /**************found**************/ p=*jc(m)/jc(n)/jc(mn) 。/**************found**************/ return p。4給定程序的功能是把a(bǔ)數(shù)組中的n個(gè)數(shù),和b數(shù)組中逆序的n個(gè)數(shù)一一對(duì)應(yīng)相乘、求平方,結(jié)果存在c數(shù)組中。 例如:當(dāng)a數(shù)組中的值是:8,b數(shù)組中的值是:8 調(diào)用該函數(shù)后,c中存放的數(shù)據(jù)是:622400、44256 請(qǐng)?jiān)诔绦虻南聞澗€處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確結(jié)果。 注意:。不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include void fun(int a[], int b[], int c[], int n){ int i。 for (i=0。 in。 i++)/**************found**************/ ___1___ = (a[i] * b[n1i]) *(a[i] * b[n1i])。}main(){ int i, a[100]={1,3,5,7,8}, b[100]={2,3,4,5,8}, c[100]。/**************found**************/ fun(___2___, 5)。 printf(The result is: )。/**************found**************/ for (i=0。 i5。 i++) printf(%d , ___3___)。 printf(\n)。}// :/**************found**************/ c[i] = (a[i] * b[n1i]) *(a[i] * b[n1i])。/**************found**************/ fun(a, b, c, 5)。/**************found**************/ for (i=0。 i5。 i++) printf(%d , c[i])。4給定程序的功能是把s串中所有的字母改寫成該字母的下一個(gè)字母,字母z改寫成字母a。大寫字母仍為大寫字母,小寫字母仍為小寫字母,其它的字符不變。 例如:s串中原有的字符串為:,則調(diào)用該函數(shù)后,s串中的內(nèi)容為:。 請(qǐng)?jiān)诔绦虻南聞澗€處填入正確的內(nèi)容并把下劃線刪除,使程序得出正確結(jié)果。 注意:。不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include include include define N 81fun ( char *s ){/**************found**************/ char *p = ___1___ 。 while(*p) {/**************found**************/ if(*p == 39。Z39。) *p = ___2___ 。/**************found**************/ else if(*p == 39。z39。) *p = ___3___ 。 else if(isalpha(*p)) *p = (*p) + 1 。 p++ 。 }}main( ){ char a[N]。 printf ( Enter a string : )。 gets ( a )。 printf ( The original string is : )。 puts( a )。 fun ( a )。 printf ( The string after modified : )。 puts ( a )。}// :/**************found**************/ char *p = s 。/**************found**************/ if(*p == 39。Z39。) *p = 39。A39。 。/**************found**************/ else if(*p == 39。z39。) *p = 39。a39。 。2. 改錯(cuò)題(50)5fun函數(shù)的功能是:先從鍵盤上輸入一個(gè)3行3列矩陣的各個(gè)元素的值,然后輸出主對(duì)角線元素之積。 請(qǐng)改正程序中的錯(cuò)誤,或在橫線處填上適當(dāng)?shù)膬?nèi)容并把橫線刪除,使它能得出正確的結(jié)果。 注意:不要改動(dòng)main函數(shù),不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include int fun(){ int a[3][3],sum。 int i,j。/************found************/ _______。 for (i=0。i3。i++) { for (j=0。j3。j++)/************found************/ scanf(%d a[i][j])。 } for (i=0。i3。i++) sum=sum*a[i][i]。 printf(Sum=%d\n,sum)。}main(){ fun()。 }// :/************found************/sum=1。
/************found************/scanf(%d,amp。a[i][j])。
5:讀入一個(gè)整數(shù)k(2≤k≤10000),打印它的所有質(zhì)因子(即所有為素?cái)?shù)的因子)。例如,若輸入整數(shù):2310,則應(yīng)輸出:11。 請(qǐng)改正程序中的語(yǔ)法錯(cuò)誤,使程序能得出正確的結(jié)果。 注意:不要改動(dòng)main函數(shù),不得增行或刪行,也不得更改程序的結(jié)構(gòu)!/************/include include include /************found************/Isprime(int n)。{ int i,m。 m=1。 for(i=2。in。i++)/************found************/ if !(n%i) { m=0。break。} return(m)。}main(){int j,k。 system(cls)。 printf(\nPlease enter an integer number between 2 and 10000:)。scanf(%d,amp。k)。 printf(\n\nThe prime factor(s) of %d is (are):,k)。 for(j=2。j=k。j++) if ((!(k%j))amp。amp。(Isprime(j))) printf(\n %4d,j)。 printf(\n)。}// :/************found************/Isprime(n)/************found************/if (!(n%i))5函數(shù)fun的功能是:用冒泡法對(duì)6個(gè)字符串按由小到大的順序進(jìn)行排序。 請(qǐng)改正程序中的錯(cuò)誤,使它能得出正確的結(jié)果。
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1