- 1、本文档共11页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
求出各行元素之和(Find the sum of the elements of each row)
求出各行元素之和(Find the sum of the elements of each row)
Nine point one
Correct the errors in the program, enter 2 positive integers m and n (m=1, n=9), and then enter the M line, n column, two-dimensional array of elements in a, respectively, the sum of the elements of the line, and output.
#include stdio.h
Int, main ()
{
Int, a[6][6], I, J, m, N, sum;
Printf (input m, n:);
Scanf (%d%d, m, n);
Printf (input array:\n);
For (i=0; im; i++) when setting a breakpoint debugging / * * /
For (j=0; jn; j++)
Scanf (%d, a[i][j]);
For (i=0; im; i++) {
Sum=0;
For (j=0; jn; j++)
Sum=sum+a[i][j];
Printf (sum of row%d is%d\n, I, sum); / * * / set a breakpoint debugging
}
Return 0;
}
Nine point two
Enter a positive integer repeat (0repeat10), do repeat times the following operations:
Read 1 positive integer n (n = 1 ~ 6), followed by a n order matrix, the matrix calculation in the last column, diagonal side and all elements other than the last line. (and vice diagonal matrix from upper right to lower left corner of the line)
Example: there is a note in parentheses
Input sample:
1 (repeat=1)
4 (n=4)
2341
5611
7181
1111
Output sample:
Sum=35 (2+3+4+5+6+7+8=35)
#includestdio.h
Int main (void)
{
Int, RI, repeat, I, J, sum, n;
Int a[6][6];
Scanf (%d, repeat);
For (ri=1; ri=repeat; ri++) {
Scanf (%d, n);
Sum=0;
For (i=0; in; i++)
For (j=0; jn; j++)
{
Scanf (%d, a[i][j]);
If (I, =n-1j, =n-1i+j, =n-1!)
Sum=sum+a[i][j];
}
Printf (sum=%d\n, sum);
}
Return 0;
}
Nine point three
Enter a positive integer repeat (0repeat10), do repeat times the following operations:
Enter 1 positive integers n (n = 1 ~ 10), the output of a less than 20 addition tables. Addend and the summand is not greater than N, the breakdown of the first row and first column. (the array output, and into the augend addend to a two-dimensional array.)
Example: there is a note in parentheses
Input sample:
1 (repeat=1)
3 (n=3)
Output sample:
+ 123
12
234
3456
#includestdio.h
(main)
{
Int, RI, repeat, n;
Int, a[11][11], I, j;
Scanf (%d,
您可能关注的文档
- 武汉服装搭配培训课程简介,服装导购培训课程,服装销售精英(Wuhan clothing collocation training course introduction, clothing shopping guide training courses, clothing sales elite).doc
- 武汉市首届小学生读书竞赛试卷(高年段)(Wuhan first primary school students competition test paper (high years)).doc
- 概念设计(conceptual design).doc
- 武士道(Bushido).doc
- 武汉特色小吃地点全攻略(Wuhan special snacks site Raiders).doc
- 武汉科目三(路考)电子考的心得和经验(以两厢爱丽舍为考试车辆)(Wuhan three subjects (road test) electronic test and experience (to test the Elysee hatchback vehicle)).doc
- 歪歪语音网络婚礼主持人词及配音文件包-婚礼可用词(Crooked voice network wedding host words and voice files package - wedding available words).doc
- 歪歪语音(Crooked voice).doc
- 残留溶剂测定法(Residual solvent method).doc
- 武汉理工大学无机材料科学基础名词解释(Wuhan University of Technology, inorganic materials science, basic terms, explanation).doc
最近下载
- 民事陪审员培训课件.pptx VIP
- 材料科学基础:第十二章 金属材料强韧化机制.ppt VIP
- CNAS-GL27-2009 声明检测或校准结果及与规范符合性的指南.pdf VIP
- 胃脘痛护理查房.ppt VIP
- 【行业研报】2023年肯尼亚行业企业战略规划方案及未来五年行业预测报告.docx VIP
- 人民陪审员培训课件.pptx VIP
- 《氧化还原反应方程式的配平》练习题 .pdf VIP
- 部编六年级下册第11课《十六年前的回忆》一等奖教学设计说课稿.docx VIP
- GB_T 39637-2020 金属和合金的腐蚀 土壤环境腐蚀性分类.pdf
- 聚硼硅氮烷合成、掺杂及SiBCN陶瓷应用研究.docx VIP
文档评论(0)