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

正文內(nèi)容

安徽省池州市技術(shù)學(xué)院信息技術(shù)系計(jì)算機(jī)省四級(jí)考試c語言上機(jī)考試試題及參考答案(編輯修改稿)

2024-12-22 19:24 本頁面
 

【文章內(nèi)容簡(jiǎn)介】 要定義其他變量或數(shù)組。 (34分 ) include define N 8 typedef struct {char num[10]。 float score[N]。 float ave。 }STREC。 PRINT(float a) {FILE *out。 池州職業(yè)技術(shù)學(xué)院信息技術(shù)系 計(jì)算機(jī)省四級(jí)上機(jī)全真試題 鄒汪平 11 if((out=fopen(C:\\40202001\\,w+))!=NULL) fprintf(out,ave=%,a)。 fclose(out)。 } main() {int i。 STREC st={J1003,76,89,98,99}。 void fun(STREC *p)。 fun(amp。st)。 printf(The %s39。s student scores:\n,)。 for(i=0。iN。i++)printf(%,[i])。 printf(\nave=%\n,)。 PRINT()。 } void fun(STREC *p) {int i。 float av。 av=0。 for(i=0。i8。i++) av+=pscore[i]。 pave=av/8。 } 模擬試題 8(完成 100 分 ): 改錯(cuò) :下面程序的功能是輸出字符串。 main() { char *a[]={English,Chinese,American,French}。 char *p 。 /*$ERROR1$*/ char **p int j=0。 p=a。 for(。j=4。j++) /*$ERROR2$*/ for(。j=3。j++) printf(%s\n,*p )。 /*$ERROR3$*/ printf(%s\n,*p++ )。 } 程序填空 :下面的程序把從鍵盤輸入的字符存放到一個(gè)文件中 ,以字符 ??結(jié)束輸入 ,文件名用字符數(shù)組輸入 ,請(qǐng)?zhí)羁铡? include main() {char ch,fname[10]。 ________。 /*$BLANK1$*/ FILE *fp。 printf(Input the name of file\n)。 gets(fname)。 池州職業(yè)技術(shù)學(xué)院信息技術(shù)系 計(jì)算機(jī)省四級(jí)上機(jī)全真試題 鄒汪平 12 if((fp=fopen(________))==NULL) /*$BLANK2$*/ fname, w {printf(Cannot open this file!\n)。exit(0)。} while((ch=getchar())!=39。39。) fputc(_______)。 /*$BLANK3$*/ ch,fp fclose(fp)。 } 程序填空 :刪除字符串 ”***A*BC*DEF*G***”中前面的全部 ?*?字符 ,然后輸出。尾部和中間的 ?*?字符不刪除。 include PRINT(char s[]) { FILE *out。 if((out=fopen(C:\\40202001\\,w+))!=NULL) fputs(s,out)。 fclose(out)。 } char s[]=***A*BC*DEF*G***。 main() {int i,j。 i=0。 while(s[i++]==39。*39。)。 for(j=i1,i=0。s[j]!=39。\039。i++,j++)s[i]=s[j]。 s[i]=39。\039。 printf(%s\n,s)。 PRINT(s)。 } 模擬試題 9(完成 100 分) : 改錯(cuò) :下面程序是將指定的源文件 (yuan)中的內(nèi)容復(fù)制到指定的目標(biāo)文件 (mubiao)中 ,請(qǐng)改錯(cuò)。 (30 分 ) include include main() { FILE *fp1,*fp2。 char c。 fp1=fopen(yuan,r)。 fp2=fopen(mubiao,r)。 /*$ERROR1$*/ fp2=fopen(mubiao,w)。 c=fgetc(fp1)。 while(!feof(fp2)) /*$ERROR2$*/ while(!feof(fp1)) { putchar(c)。 putc(fp2)。 /*$ERROR3$*/ fputc(c,fp2)。 c=fgetc(fp1)。 池州職業(yè)技術(shù)學(xué)院信息技術(shù)系 計(jì)算機(jī)省四級(jí)上機(jī)全真試題 鄒汪平 13 } fclose(fp1)。 fclose(fp2)。 } 程序填空 :以下函數(shù) acopy 的功能是 ,將整型數(shù)組 a 的內(nèi)容按逆序復(fù)制到整型數(shù)組 b 之中 (999 為數(shù)組的結(jié)束標(biāo)志 ),請(qǐng)?zhí)羁铡?(30分 ) include void acopy(_______) /*$BLANK1$*/ int a[ ] , int b[ ] { int i=0,j=0。 while(*(a+j)!=999) j++。 b[j]=a[j]。 j。 while(a[i]!=999) { ________。 /*$BLANK2$*/ b[j]=a[i]。 i++。j。 } } main() { static int a[]={1,3,5,7,9,2,4,6,8,10,999}。 int b[80],i=0。 acopy(a,b)。 while(b[i]!=999) printf(%3d,_____)。 /*$BLANK3$*/ b[i++] } 程序設(shè)計(jì) :編寫程序中求兩個(gè)復(fù)數(shù)和的函數(shù) fun。請(qǐng)不要定義其它變量或數(shù)組。 (40 分 ) include struct p {int x, y。}。 void PRINT(struct p n) {FILE *out。 if((out=fopen(C:\\40202001\\,w+))!=NULL) fprintf(out,=%d,=%d,)。 fclose(out)。 } main( ) { struct p fun(struct p,struct p)。 struct p a,b,c。 =1。=2。=3。=4。 c=fun(a,b)。 printf(=%d,=%d\n,)。 PRINT(c)。 } 池州職業(yè)技術(shù)學(xué)院信息技術(shù)系 計(jì)算機(jī)省四級(jí)上機(jī)全真試題 鄒汪平 14 struct p fun(struct p u, struct p v) { struct p w。 =+。 =+。 return (w)。 } 模擬試題 10(完成 77 分) : 改錯(cuò) :下列程序中函數(shù) month_name的功能是 :輸入 1~12 之間的整數(shù) ,輸出對(duì)應(yīng)的月份名 ,請(qǐng)改錯(cuò)。 ( 30 分) include char *month_name(char *name[],int n) { char *p1,*p2。 p1=name。 /*$ERROR1$*/ p1=*name。 p2=name+n。 /*$ERROR2$*/ p2=*(name+n) return((n1||n12)?p1:p2)。 } main() { char *name[] ={Illegalmonth,January,February,March, April,May,June, July,August,September, October,November,December}。 char *ps。 int i。 printf(Input Month No:\n)。 scanf(%d,amp。i)。 if(i0)exit(1)。 ps=month_name(*name[],i)。 /*$ERROR3$*/ ps=month_name(name,i) printf(Month No:%2d%s\n,i,ps)。 } 程序填空 :以下程序?qū)崿F(xiàn)將鍵盤輸入的一些字符 (以 ??結(jié)束 )追加到以文本文件 。 ( 30分) include main() {char c。 _________。 /*$BLANK1$*/ FILE *fp。 if ((fp=fopen(,____))==NULL) /*$BLANK2$*/ a {printf(can not open file !)。exit(1)。} while((c=getchar())!=39。39。) fputc(_________)。 /*$BLANK3$*/ c,fp fclose(fp)。 } 程序設(shè)計(jì): 用指針方法 統(tǒng)計(jì)字符串 ”this is a beg we are student”中單詞的個(gè)數(shù)。規(guī)定單詞由小寫字母組成 ,單詞之間由池州職業(yè)技術(shù)學(xué)院信息技術(shù)系 計(jì)算機(jī)省四級(jí)上機(jī)全真試題 鄒汪平 15 空格分隔 ,字符串開始和結(jié)束沒有空格。 (17 分 ) include PRINT(int n) { FILE *out。 if((out=fopen(C:\\40202001\\,w+))!=NULL) fprintf(out,n=%d,n)。 fclose(out)。 } main() {char s[]=this is a beg we are students。 int n。 int i=0。 char *p p=s。 n=1。 while(*p!=39。\039。) {if(*p==39。 39。)n++。 p++。 } printf(%d\n,n)。 PRINT(n)。 } 模擬試題 11: 改錯(cuò):將鍵盤輸入的數(shù)據(jù)存入整型數(shù)組a中,然后輸出到文件 中,請(qǐng)改錯(cuò)。 include main() {FILE *fp。 int a[10],i。 if((fp=fopen(, wb))==NULL) {printf(Can39。t open file.\n)。exit(0)。} for(i=0。i10。i++) scanf(%d,a[i])。 /*$ERROR1$*/ scanf(%d,& a[i]) fwrite(fp,a,2,10)。 /*$ERROR2$*/ fwrite(a,2,10,fp) fclose()。 /*$ERROR3$*/ } fclose(fp) 程序填空:從鍵盤輸入 字符 串 ,以回車結(jié)束.通過指針操作,將所有大寫字母轉(zhuǎn)換為小寫字母,其它字符不變,請(qǐng)?zhí)羁眨? include main() {int i=0。 char s[80],*p。 printf(INPUT STRING:\n)。 池州職業(yè)技術(shù)學(xué)院信息技術(shù)系 計(jì)算機(jī)省四級(jí)上機(jī)全真試題 鄒汪平 16 while((s[i]=getchar())___39。\n39。) /*$BLANK1$*/ != i++。 p=s。 while(___!=39。\n39。) /*$BLANK2$*/ *p {if(*p=39。A39。amp。am
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1