- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
在线作业指针作函数参数用法(The online job pointer is used as function parameter)
在线作业指针作函数参数用法(The online job pointer is used as function parameter) 9.11 odd or even numbers in an array Results: 100 / Discount: 0.8 Please make up a function fun (int, *a, int, N, *odd, int, *even, int). The function of the function is to find the sum of all odd numbers in the array, and the sum of all even numbers. The parameter n gives the number of data in the array: returns the sum of the odd numbers by using the pointer odd, and returns the sum of the even numbers by the pointer even. For example: the values in the array are: 1, 8, 2, 3, 11, 6, and then use the pointer odd to return the odd numbers and 15; use the pointer even to return the even numbers and 16. Part of the program source code is as follows. #include stdio.h #define N 20 Void, fun (int, *a, int, N, int, *odd, int, *even) {int i; *odd=*even=0; For (i=0; in; i++) If (a[i]%2==0) *even=*even+a[i]; Else *odd=*odd+a[i]; } Int, main () {int, a[N], I, N, odd, even; Scanf (%d, n); For (i=0; in; i++) Scanf (%d, a[i]); Fun (a, N, odd, even); Printf (The, sum, of, numbers:%d\n, odd, odd); Printf (The, sum, of, number:%d\n, even, even); Return 0; } Test input, expected output time limit, memory limit, extra process Test case 1 shows 6 in text mode 1823116? Display The, sum, of, odd, numbers:15 in text mode? The, sum, of, even, number:16? Unlimited 64M 0 9.12 floating points, four, five Results: 100 / Discount: 0.8 Please make a function float fun (double, a, double, *h). The function of the function is to keep 2 decimal places for the value in the variable H, and to do four to five entries for third bits (the value in the H is positive). For example, the H value is 8.32433, and the function returns 8.32; The H value is 8.32533, and the function returns 8.33. Part of the program source code is as follows. #include stdio.h Void fun (double, a, double, *h) {int, B, c; B= (int) (a*1000); C=b%10; If (c=5) b= (b-c+10) /10; If (c5) b=b/10; *h= (float) b/100; } Int, main () { Double, a, h; Scanf (%lf, a); Fun (a,
您可能关注的文档
- 只问价格不问价值的文学时代(A literary age asking only price and no value).doc
- 叫水法(Water law).doc
- 可 米 路 贝 儿 四 色(Belle four-color comic way).doc
- 可以去记记的歌词(You can remember the lyrics).doc
- 可口可乐 成功(Coca-Cola success).doc
- 口译笔译分类词汇--体育运动词汇(Interpreting, translation, classification, vocabulary -- sports vocabulary).doc
- 可口可乐公司使命与战略目标(Mission and strategic objectives of Coca Cola Co).doc
- 可口可乐引导社会化营销(Coca-Cola leads social marketing).doc
- 可口可乐的面试题目(Coca-Cola interview questions).doc
- 可口麦田 巧克力朝圣之旅 畅享丝滑的幸福滋味(Delicious chocolate in the wheat fields; a pilgrimage trip; a silky happiness).doc
- 在片区区域发展与扶贫攻坚规划审查专题办公会上的讲话(Speech at the special office meeting on regional development and poverty alleviation Planning Review).doc
- 在新任职干部交接班会上的讲话(Speech at the handover meeting of newly appointed cadres).doc
- 在希腊神话中,爱神与战神私通,被爱神的丈夫用一张大网捉住,众神哄堂大笑。特洛伊王子埃涅阿斯写成是神的(In Greek mythology, with Venus and Mars, love her husband with a net to catch the gods set the whole room roaring with laughter. Prince Troy, Aeneas, w.doc
- 在职场混好必读的22本书(There are 22 books that must be read well on the job).doc
- 在某一时某一刻 那些让人微微心痛的经典语句(In a moment, a moment, those who make people slightly sad classic sentences).doc
- 在职攻读硕士学位全国联考英语考试大纲词汇表6(Studying for master degree in national exam English syllabus vocabulary 6).doc
- 在自主学习中感受快乐——小学一年级语文课《快乐的节日》教学设计(Experiencing pleasure in self study -- Teaching Design of happy festival in grade one Chinese language lesson).doc
- 在非storage server 2003下,windows NFS 配置(用于ESXserver)(2003下在非存储服务器,Windows NFS配置(用于esxserver)).doc
- 地中海风格(Mediterranean style).doc
- 在计算过程中提高学习能力(Improve your learning ability in the process of calculation).doc
文档评论(0)