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

正文內(nèi)容

全國計算機(jī)等級考試三級c語言程序設(shè)計上機(jī)考試習(xí)題集20xx年版-資料下載頁

2025-06-13 21:04本頁面

【導(dǎo)讀】題目前帶★號的是在20xx年4月份上機(jī)考試中被考生們所確定了的上機(jī)題。k個素數(shù)存入數(shù)組xx傳回。把結(jié)果輸出到文件中。出:19,23,29,31,37。最后main()函數(shù)調(diào)用寫函

  

【正文】 ) if (b[I]b[j]) {qw=b[I]。b[I]=b[j]。b[j]=qw。} } void readDat() { int i 。 FILE *fp 。 fp = fopen(, r) 。 for(i = 0 。 i MAX 。 i++) fscanf(fp, %d, amp。a[i]) 。 fclose(fp) 。 } void main() { int i 。 readDat() 。 jsVal() 。 printf(滿足條件的數(shù) =%d\n, t) 。 for(i = 0 。 i t 。 i++) printf(%d , b[i]) 。 printf(\n) 。 writeDat() 。 } writeDat() { FILE *fp 。 int i 。 fp = fopen(, w) 。 fprintf(fp, %d\n, t) 。 for(i = 0 。 i t 。 i++) fprintf(fp, %d\n, b[i]) 。 fclose(fp) 。 } ***************************★ 題目 16(無憂 id 23 題 ) 函數(shù) ReadDat()實(shí)現(xiàn)從文件 中讀取一篇英文文章存入到字符串?dāng)?shù)組 xx 中,請編制函數(shù) StrCharJR(),其函數(shù)的功能是:以行為單位把字符串中所有字符的 ASCII 值右移 4全國計算機(jī)等級考試三級 C 語言程序設(shè)計上機(jī)考試習(xí)題集( 20xx 年版)【終極無錯版】 10 位,然后把右移后的字符 ASCII值再加上原字符的 ASCII 值,得到新的字符仍存入原字符串對應(yīng)的位置上。最后把已處理的字符串仍按行重新存入字符串?dāng)?shù)組 xx 中,最后調(diào)用函數(shù)writeDat()把結(jié)果 xx 輸出到文件 中。 原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于 80 個字符,含標(biāo)點(diǎn)符號和空格。 部分源程序存在文件 中。 請勿改動主函數(shù) main()、讀數(shù)據(jù)函數(shù) ReadDat()和輸出數(shù)據(jù)函數(shù) writeDat()的內(nèi)容。 include include include char xx[50][80]。 int maxline=0。/*文章的總行數(shù) */ int ReadDat(void)。 void WriteDat(void)。 void StrCharJR() {int i,j。 for(i=0。imaxline。i++) for(j=0。jstrlen(xx[i])。j++) xx[i][j]+=(xx[i][j]4)。 } void main() { clrscr()。 if(ReadDat()){ printf(數(shù)據(jù)文件 不能打開! \n\007)。 return。 } StrCharJR()。 WriteDat()。 } int ReadDat(void) { FILE *fp。 int i=0。 char *p。 if((fp=fopen(,r))==NULL) return 1。 while(fgets(xx[i],80,fp)!=NULL){ p=strchr(xx[i],39。\n39。)。 if(p)*p=0。 i++。 } maxline=i。 fclose(fp)。 return 0。 } void WriteDat(void) { FILE *fp。 int i。 clrscr()。 fp=fopen(,w)。 for(i=0。imaxline。i++){ printf(%s\n,xx[i])。 fprintf(fp,%s\n,xx[i])。 } fclose(fp)。 } ***************************題目 17 函數(shù) READDAT()實(shí)現(xiàn)從文件 中讀取一篇英文文章存入到字符串?dāng)?shù)組 XX 中 。請編制函數(shù) CHA(),其函數(shù)功能是 :以行為單位把字符串中的第一個字符的 ASCII 值加第二個字符的 ASCII 值,得到第一個親朋字符,第二個字符的 ASCII 值加第三個字符的 ASCII 值,得到第二個新字符,依此類推一直處理到最后第二個字符,最后一個字符的 ASCII 值加原第一個字符的 ASCII 值,得到最后一個新的字符,得到的新字符分別存放在原字符串對應(yīng)的位置上。最后把已處理的字符串逆轉(zhuǎn)后按行重新存入字符串?dāng)?shù)組 XX 中 ,最 后調(diào)用函數(shù)WRITEDAT()把結(jié)果 XX 輸出到文件 中 .原始數(shù)據(jù)文件存放的格式是 :每行的寬度均小于 80 個字符 ,含標(biāo)點(diǎn)符號和空格 . 注意:部分源程序已給出。 請勿改動主函數(shù) main()、讀數(shù)據(jù)函數(shù) ReadDat()和輸出數(shù)據(jù)函數(shù) writeDat()的內(nèi)容。 include include include char xx[50][80] 。 int maxline = 0 。 /* 文章的總行數(shù) */ int ReadDat(void) 。 void WriteDat(void) 。 void ChA(void) { int i,j。 char ch。 for(i=0。imaxline。i++) { ch=xx[i][0]。 for(j=0。jstrlen(xx[i])1。j++) xx[i][j]+=xx[i][j+1]。 xx[i][strlen(xx[i])1]+=ch。 strrev(xx[i])。 } } void main() { clrscr() 。 if(ReadDat()) { printf(數(shù)據(jù)文件 不能打開 !\n\007) 。 return 。 } ChA() 。 WriteDat() 。 } int ReadDat(void) { FILE *fp 。 int i = 0 。 char *p 。 if((fp = fopen(, r)) == NULL) return 1 。 while(fgets(xx[i], 80, fp) != NULL) { p = strchr(xx[i], 39。\n39。) 。 if(p) *p = 0 。 i++ 。 } maxline = i 。 fclose(fp) 。 return 0 。 } void WriteDat(void) { FILE *fp 。 int i 。 clrscr() 。 fp = fopen(, w) 。 for(i = 0 。 i maxline 。 i++) { 全國計算機(jī)等級考試三級 C 語言程序設(shè)計上機(jī)考試習(xí)題集( 20xx 年版)【終極無錯版】 11 printf(%s\n, xx[i]) 。 fprintf(fp, %s\n, xx[i]) 。 } fclose(fp) 。 } ***************************題目 18(無憂 id 1 題 ) 函數(shù) ReadDat()實(shí)現(xiàn)從文件 中讀取一篇英文文章,存入到字符串?dāng)?shù)組 xx 中;請編制函數(shù) encryptChar(),按給定的替代關(guān)系對數(shù)組 xx 中的所有字符進(jìn)行替代,仍存入數(shù)組 xx 的對應(yīng)的位置上,最后調(diào)用函數(shù)WriteDat()把結(jié)果 xx 輸出到文件 中。 替代關(guān)系: f(p)=p*11 mod 256( p 是數(shù)組中某一個字符的ASCII 值, f(p)是計算后新字符的 ASCII 值),如果原字符的ASCII 值是偶數(shù)或計算后 f(p)值小于等于 32,則該字符不 變,否則將 f(p)所對應(yīng)的字符進(jìn)行替代。 部分源程序存在文件 中。原始數(shù)據(jù)文件存放的格式是:每行的寬度均小于80 個字符。 請勿改動主函數(shù) main()、讀數(shù)據(jù)函數(shù) ReadDat()和輸出數(shù)據(jù)函數(shù) WriteDat()的內(nèi)容。 include include include include unsigned char xx[50][80]。 int maxline=0。/*文章的總行數(shù) */ int ReadDat(void)。 void WriteDat(void)。 void encryptChar() { int i,j。 for(i=0。imaxline。i++) for(j=0。jstrlen(xx[i])。j++) if(xx[i][j]*11%256=32||xx[i][j]%2==0) continue。 else xx[i][j]=xx[i][j]*11%256。 } void main() { clrscr()。 if(ReadDat()){ printf(數(shù)據(jù)文件 不能打開! \n\007)。 return。 } encryptChar()。 WriteDat()。 } int ReadDat(void) { FILE *fp。 int i=0。 unsigned char *p。 if((fp=fopen(,r))==NULL) return 1。 while(fgets(xx[i],80,fp)!=NULL){ p=strchr(xx[i],39。\n39。)。 if(p)*p=0。 i++。 } maxline=i。 fclose(fp)。 return 0。 } void WriteDat(void) { FILE *fp。 int i。 fp=fopen(,w)。 for(i=0。imaxline。i++){ printf(%s\n,xx[i])。 fprintf(fp,%s\n,xx[i])。 } fclose(fp)。 } ***************************題目 19(無憂 id 144 題 ) 編寫一個函數(shù) findStr(char *str,char *substr),該函數(shù)統(tǒng)計一個長度為 2 的子字符串在另一個字符串中出現(xiàn)的次數(shù)。例如,假定輸入的字符串為 asd asasdfg asd as zx67 asd mklo,子字符串為 as,函數(shù)返回值是6。 函數(shù) ReadWrite()實(shí)現(xiàn)從文件 中讀取兩個字符串,并調(diào)用函數(shù) findStr(),最后把結(jié)果輸出到文件 中。 注意:部分源程序存在文件 中。 請勿改動主函數(shù) main()和其它函數(shù)中的 任何內(nèi)容,僅在函數(shù) findStr()的花括號中填入你編寫的若干語句。 include include include int findStr(char *str,char *substr) { int n=0。 char *p , *r。 while ( *str ) {p=str。 r=substr。 while(*r) if(*r==*p) { r++。 p++。 } else break。 if(*r==39。\039。) n++。 str++。 } return n。 } main() { char str[81], substr[3] 。 int n 。 clrscr() 。 printf(輸入原字符串 :) 。 gets(str) 。 printf(輸入子字符串 :) 。 gets(substr) 。 puts(str) 。 puts(substr) 。 n=findStr(str, substr) 。 printf(n=%d\n, n) 。 ReadWrite() 。 } ReadWrite() { char str[81], substr[3], ch。 int n, len, i = 0。 FILE *rf, *wf 。
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1