![二級c上機編程答案※※a※b……題型(Two level C programming on the answer of a a B...... Questions)_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/14/22e74d1e-a466-48c9-95c0-ada97ee13b43/22e74d1e-a466-48c9-95c0-ada97ee13b431.gif)
![二級c上機編程答案※※a※b……題型(Two level C programming on the answer of a a B...... Questions)_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/14/22e74d1e-a466-48c9-95c0-ada97ee13b43/22e74d1e-a466-48c9-95c0-ada97ee13b432.gif)
![二級c上機編程答案※※a※b……題型(Two level C programming on the answer of a a B...... Questions)_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/14/22e74d1e-a466-48c9-95c0-ada97ee13b43/22e74d1e-a466-48c9-95c0-ada97ee13b433.gif)
![二級c上機編程答案※※a※b……題型(Two level C programming on the answer of a a B...... Questions)_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/14/22e74d1e-a466-48c9-95c0-ada97ee13b43/22e74d1e-a466-48c9-95c0-ada97ee13b434.gif)
![二級c上機編程答案※※a※b……題型(Two level C programming on the answer of a a B...... Questions)_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-7/14/22e74d1e-a466-48c9-95c0-ada97ee13b43/22e74d1e-a466-48c9-95c0-ada97ee13b435.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、二級c上機編程答案ab題型(Two level C programming on the answer of a a B. Questions)4. specifies that the input string contains only letters and * numbers. Write the function fun, whose function is to delete all the * numbers in a string. When writing functions, string functions provided by the C language must
2、not be used.For example, the contents of the string are: *A*BC*DEF*G*, and the contents of the string after deletion should be: ABCDEFG.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, and any other functions. Just fill in the few parentheses you have wr
3、itten in the curly braces of the function fun.reference answerVoid fun (char *a)Int, I, j = 0;For (I = 0; ai! = 0; I)If (ai! = *Aj = ai; / * if not to delete the character * left.Aj = 0; / * add the final end of string 0.12. specifies that the input string contains only letters and * numbers. Please
4、 write function fun, its function is: in addition to the leading string * number, the string will be deleted all other *. When writing functions, string functions provided by the C language must not be used.For example, the contents in the string are: *A*BC*DEF*G*, and the contents of the string sho
5、uld be: *ABCDEFG after deletion.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, and any other functions. Just fill in the few parentheses you have written in the curly braces of the function fun.reference answerVoid fun (char *a)Int i = 0;Char *p = a;Wh
6、ile (*p&*p = = * )Ai = *p; I; P;While (*p)If (*p! = *Ai = *p; I;P;Ai = 0;14. specifies that the input string contains only letters and * numbers. Please write the function fun, its function is: the string tail * number all delete, front and middle of the * number is not moving.For example, the conte
7、nts in the string are: *A*BC*DEF*G*, and the contents of the string should be: *A*BC*DEF*G after deletion. When writing functions, string functions provided by the C language must not be used.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, and any other
8、 functions. Just fill in the few parentheses you have written in the curly braces of the function fun.reference answerVoid fun (char *a)While (*a! = 0A;A; / * a is a pointer to the end of the string.While (*a = = * )A; / * a is a pointer to the last letter.* (A1) = 0; / * in the string added to the
9、end of the end of the identifier.19. specifies that the input string contains only letters and * numbers. Please write the function fun, whose function is to move the leading * numbers in the string to the tail of the string.For example, the contents in the string are: *A*BC*DEF*G*, and after moving
10、, the contents of the string should be: A*BC*DEF*G*. When writing functions, string functions provided by the C language must not be used.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, and any other functions. Just fill in the few parentheses you have
11、written in the curly braces of the function fun.reference answerVoid fun (char *a)Int i = 0, n = 0;Char *p;P = a;While (*p = = / * *) to determine whether the *p is * *, and a number of statistics.N; P;While (*p) / * * will be leading the character after the transfer to a*/Ai = *p; I; P;While (n! =
12、0)Ai = *; I; n;Ai = 0;22. specifies that the input string contains only letters and * numbers.Please write the function fun, its function is: only delete characters leading and tail * number, string of letters between the * number are not deleted. The parameter n gives the length of the string, and
13、the parameter H gives the number of the leading alpha in the string. The parameter e gives the number of the tail * number in the string. When writing functions, string functions provided by the C language must not be used.For example, the contents in the string are: *A*BC*DEF*G*, and the contents o
14、f the string should be: A*BC*DEF*G after deletion.reference answerVoid, fun (char, *a, int, N, int, h, int, e)Int, I, j = 0;For (I = h; Ine; / * I) between the first letter and the last character does not delete.Aj = ai;Aj = 0; / * in the string plus end mark * /25. assume that the input string cont
15、ains only letters and * numbers. Please write function fun, its function is: in addition to the tail * number, will be in the characters of the other * number all deleted. The parameter P has been pointing to the last letter in the string. When writing functions, string functions provided by the C l
16、anguage must not be used.For example, the content in the string is *A*BC*DEF*G*, and the content in the string should be ABCDEFG* after deletion.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, and any other functions. Just fill in the few parentheses yo
17、u have written in the curly braces of the function fun.reference answerVoid fun (char, *a, char, *p)Char *t = a;(for; t = p; T)If (*t! = * (a + +) = *t; / * p *, not all previous characters retained.For (*t)! = 0; T)* (a + +) = *t; / * P after all * * / preserved*a = 0; / * in the end with the end o
18、f the string string ID *29. specifies that the input string contains only letters and * numbers. Write function fun, its function is: the preamble of the string * delete all, the middle and tail of the * number is not deleted.For example, the contents of the string are: *A*BC*DEF*G*, and the content
19、s of the string after deletion should be: A*BC*DEF*G*. When writing functions, string functions provided by the C language must not be used.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, and any other functions. Just fill in the few parentheses you hav
20、e written in the curly braces of the function fun.reference answerVoid fun (char *a)Char *p = a;While (*p = = * )P + + p; / * pointer to the string the first letter.For (*p)! = 0; P, A)*a = *p; / * from the beginning of the first letter, then the character string pointer into a refers to the.*a = 0;
21、 / * in the end with the end of the string string ID *We offer another solution here.#includeVoid fun (char *a)char *p = a;While (*p = = *) P;Strcpy (a, P);43. specifies that the input string contains only letters and * numbers. Write a function fun, its function is: in addition to leading and trail
22、ing string * number, will on other * delete all. The parameter h has been pointing to the first letter in the string, and the parameter p points to the last letter in the string. When writing functions, string functions provided by the C language must not be used.For example, if the content in the s
23、tring is *A*BC*DEF*G*, then the contents of the string should be: *ABCDEFG*. When writing functions, string functions provided by the C language must not be used.Note: part of the source is in the file PROG1.C.Do not change any of the main functions, main, or any other functions,Fill in the few stat
24、ements you wrote in the curly braces of function fun only.reference answerVoid fun (char, *a, char, *h, char, *p)Int i = 0;Char *q = a;While (qh) / * * / * number of leading endAi = *q; Q; I;While (qn) / * if K is greater than N, then the P front retains n an asterisk following characters sequential
25、ly stored in the array a.while (*p)ai = * (Pkn);I;P;Ai = 0; / * in the string plus the last bit.52. specifies that the input string contains only letters and * numbers. Please write the function fun, its function is: the string in the tail of the * number is not more than N, if more than N, then remove the extra *; if less than or equal to N, then do not do any operation, and in front of the middle of the string does not delete *.For example, a string
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 供暖承包合同
- 裝修總承包合同
- 標識標牌制作合同
- 數(shù)據(jù)存儲與分析服務合同
- 英文服務合同范本
- 精技術(shù)合作開發(fā)合同
- 合同主體變更協(xié)議
- 房屋買賣居間合同簽訂注意事項
- 關(guān)于固定期限聘用合同
- 公對公的借款合同正規(guī)范本
- 商標法基礎(chǔ)知識
- 2025年高考物理一輪復習之機械振動
- 醫(yī)院醫(yī)務人員醫(yī)德考評標準
- 小批量試制總結(jié)報告
- 2023年經(jīng)濟開發(fā)區(qū)工作會議表態(tài)發(fā)言
- YY/T 0216-1995制藥機械產(chǎn)品型號編制方法
- 糖尿病足與周圍血管病01課件
- 2022年試行林木采伐管理方案
- 消防設(shè)施操作員報名承諾書
- 灌腸操作評分標準
- 企業(yè)年金基金管理機構(gòu)基本服務和收費標準規(guī)范規(guī)范行業(yè)自律公約
評論
0/150
提交評論