重庆美图库!!
查看: 800|回复: 1
打印 上一主题 下一主题
收起左侧

[原创]C语言_学习题套_第一套

[复制链接]
1
跳转到指定楼层
发表于 2007-2-1 13:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
重庆商务网,重庆电子商务第一网!

登陆享受更多浏览权限哟~

您需要 登录 才可以下载或查看,没有帐号?入驻经典

x
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman';">第一套</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">题目:成绩排名</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">一.语言和环境</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">A.</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">实现语言</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt;"><span lang="EN-US"><font face="Times New Roman">C</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">语言</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">B</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">.环境要球</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>TubroC2.0</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">或</span><span lang="EN-US"><font face="Times New Roman">TubroC3.0</font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">二</span><span lang="EN-US"><font face="Times New Roman">.</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">要求</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">在某次运动会中,某学校派出五名学生参加男子五项:跳远、标枪、</span><chmetcnv wst="on" unitname="米" sourcevalue="200" hasspace="False" negative="False" numbertype="1" tcsc="0"><span lang="EN-US"><font face="Times New Roman">200</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">米</span></chmetcnv><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、铁饼和</span><chmetcnv wst="on" unitname="米" sourcevalue="1500" hasspace="False" negative="False" numbertype="1" tcsc="0"><span lang="EN-US"><font face="Times New Roman">1500</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">米</span></chmetcnv><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">全能比赛。各个参赛学生的各项比赛成绩已知(参见图</span><span lang="EN-US"><font face="Times New Roman">1</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">)。学校为了给参赛学生发奖,请根据总积分给参赛的学生排名。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">三.算法说明</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">采用冒泡排序法根据总积分从高到低进行排序。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">四.推荐实现步骤</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">2</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、编写</span><span lang="EN-US"><font face="Times New Roman">main</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">函数</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.5pt; mso-para-margin-left: 1.0gd;"><span lang="EN-US"><font face="Times New Roman">1</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">)在</span><span lang="EN-US"><font face="Times New Roman">main</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">函数中定义一个二维数组,用以存放各个学生的比赛成绩,轻重数组复制必须根据图</span><span lang="EN-US"><font face="Times New Roman">1</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">所示的结果进行。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.5pt; mso-para-margin-left: 1.0gd;"><span lang="EN-US"><font face="Times New Roman">2</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">)、计算每个参赛学生的总积分,把结果存放在一个一维数组中。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.5pt; mso-para-margin-left: 1.0gd;"><span lang="EN-US"><font face="Times New Roman">3</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">)使用</span><span lang="EN-US"><font face="Times New Roman">for</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">循环输出学生的比赛成绩与总积分。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.5pt; mso-para-margin-left: 1.0gd;"><span lang="EN-US"><font face="Times New Roman">4</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">)采用冒泡排序法对存放总积分的一维数组按照从高到低进行排序。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 10.5pt; mso-para-margin-left: 1.0gd;"><span lang="EN-US"><font face="Times New Roman">5</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">)根据总积分,确定学生的编号,然后按照从高到低的顺序输出排名结果。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">3</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、程序进行参考界面如下:</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><p><font face="Times New Roman">&nbsp;</font></p></span></p><table class="MsoNormalTable" cellspacing="0" cellpadding="0" width="636" border="1" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: black; MARGIN: auto auto auto 5.4pt; BORDER-LEFT: medium none; WIDTH: 477pt; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-shading: windowtext; mso-pattern: solid black; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext;"><tbody><tr style="HEIGHT: 295.05pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes;"><td valign="top" width="636" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 477pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 295.05pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt;"><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">各个参赛学生的各项比赛成绩与总积分</span><span lang="EN-US" style="COLOR: white;"><p></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><p><font face="Times New Roman">&nbsp;</font></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">学生编号</span><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">跳远</span><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">标枪</span><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span><chmetcnv wst="on" unitname="米" sourcevalue="200" hasspace="False" negative="False" numbertype="1" tcsc="0"><font face="Times New Roman">200</font><span lang="EN-US" style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;"><span lang="EN-US">米</span></span></chmetcnv><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">铁饼</span><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span><chmetcnv wst="on" unitname="米" sourcevalue="1500" hasspace="False" negative="False" numbertype="1" tcsc="0"><font face="Times New Roman">1500</font><span lang="EN-US" style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;"><span lang="EN-US">米</span></span></chmetcnv><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">总积分</span><span lang="EN-US" style="COLOR: white;"><p></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman">1<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>78<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>78<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>86<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>100<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp; </span>87<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>429<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt 168.75pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman">2<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>88<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>79<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>86<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>100<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp; </span>87<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>440<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt 168.75pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman">3<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>98<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>78<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>86<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>100<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp; </span>87<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>449<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman">4<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>98<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>74<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>86<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>100<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp; </span>87<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>445<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman">5<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>98<span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>78<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>86<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>90<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp; </span>83<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>435<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><p><font face="Times New Roman">&nbsp;</font></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">根据总积分排名结果</span><span lang="EN-US" style="COLOR: white;"><p></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><p><font face="Times New Roman">&nbsp;</font></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">名次</span><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">总积分</span><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;"><font face="Times New Roman">&nbsp;&nbsp;&nbsp; </font></span></span></b><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">学生编号</span><span lang="EN-US" style="COLOR: white;"><p></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span lang="EN-US" style="COLOR: white;"><p><font face="Times New Roman">&nbsp;</font></p></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">第一名</span><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>449<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>3<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">第二名</span><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>445<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;</span>4<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">第三名</span><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>440<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>2<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">第四名</span><span lang="EN-US" style="COLOR: white;"><font face="Times New Roman"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>435<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>5<p></p></font></span></b></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; tab-stops: 80.25pt 126.0pt;"><b style="mso-bidi-font-weight: normal;"><span style="COLOR: white; FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">第五名</span><font face="Times New Roman"><span lang="EN-US" style="COLOR: white;"><span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>429<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>1</span><span lang="EN-US" style="COLOR: red;"><p></p></span></font></b></p></td></tr></tbody></table><p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center;"><span lang="EN-US"><p><font face="Times New Roman">&nbsp;</font></p></span></p><p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">图一</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">五、注意事项</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">A</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、学生比赛成绩必须与图</span><span lang="EN-US"><font face="Times New Roman">1</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">所示的成绩一致:由于总积分各不相同,因此可以根据总积分确定学生的编号,例如总积分</span><span lang="EN-US"><font face="Times New Roman">449</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">对应的学生编号是</span><span lang="EN-US"><font face="Times New Roman">3</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">:</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">B</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、必须输出图</span><span lang="EN-US"><font face="Times New Roman">1</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">所示的效果:</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">C</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、请注意在代码中添加必要的注释:</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US"><font face="Times New Roman">D</font></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: &quot;Times New Roman&quot;; mso-hansi-font-family: &quot;Times New Roman&quot;;">、请注意代码的书写、命名符合规范。</span></p>
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 顶 踩
发布商机信息及企业宣传推广--请移步注册重庆商务网!!
快捷入口:给经典重庆客服留言
2
 楼主| 发表于 2007-2-1 13:13 | 只看该作者
重庆女性论坛
<p>题解:</p><p>#include&lt;stdio.h&gt;<br/>void main()<br/>{<br/>&nbsp;//创建二维数据<br/>&nbsp;int student[5][5]={<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{78,78,86,100,87},<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{88,79,86,100,87},<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{98,78,86,100,87},<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{98,74,86,100,87},<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{98,78,86,90,83}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br/>&nbsp;int all[5];<br/>&nbsp;int temp;<br/>&nbsp;int num[5];<br/>&nbsp;int i=0,n=0,j=0;<br/>&nbsp;int m=0;<br/>&nbsp;for(i=0;i&lt;5;i++)<br/>&nbsp;{<br/>&nbsp;&nbsp;all=student[0]+student[1]+student[2]+student[3]+student[4];<br/>&nbsp;}</p><p>&nbsp;printf("各个学生的各项比赛成绩及总积分\n\n");<br/>&nbsp;printf("学生编号\t跳远\t标枪\t200米\t铁饼\t1500米\t总积分");<br/>&nbsp;for(n=0;n&lt;5;n++)<br/>&nbsp;{<br/>&nbsp;&nbsp;printf("\n%d\t\t%d\t%d\t%d\t%d\t%d\t%d",n+1,student[n][0],student[n][1],student[n][2],student[n][3],student[n][4],all[n]);<br/>&nbsp;}</p><p><br/>&nbsp;printf("\n根据总积分排名的结果\n");<br/>&nbsp;printf("\n名次\t总积分\t编号");</p><p>&nbsp;//排序<br/>&nbsp;for(i=5;i&gt;0;i--)<br/>&nbsp;{<br/>&nbsp;&nbsp;for(n=5;n&gt;5-i;n--)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;if(all[n]&gt;all[n-1])<br/>&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;temp=all[n];<br/>&nbsp;&nbsp;&nbsp;&nbsp;all[n]=all[n-1];<br/>&nbsp;&nbsp;&nbsp;&nbsp;all[n-1]=temp;<br/>&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;}<br/>&nbsp;&nbsp;num[5-i]=n;<br/>&nbsp;}<br/>&nbsp;for(n=0;n&lt;5;n++)<br/>&nbsp;{<br/>&nbsp;&nbsp;for(j=0;j&lt;5;j++)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;int stall=student[j][0]+student[j][1]+student[j][2]+student[j][3]+student[j][4];<br/>&nbsp;&nbsp;&nbsp;if(all[n]==stall)<br/>&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;num[n]=j+1;<br/>&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;}<br/>&nbsp;}<br/>&nbsp;printf("\n第一名\t%d\t%d",all[m],num[m]);<br/>&nbsp;printf("\n第二名\t%d\t%d",all[m+1],num[m+1]);<br/>&nbsp;printf("\n第三名\t%d\t%d",all[m+2],num[m+2]);<br/>&nbsp;printf("\n第四名\t%d\t%d",all[m+3],num[m+3]);<br/>&nbsp;printf("\n第五名\t%d\t%d",all[m+4],num[m+4]);<br/>&nbsp;getch();<br/>}<br/></p>
重庆商务网,重庆电子商务第一网,欢迎入驻!
您需要登录后才可以回帖 登录 | 入驻经典

本版积分规则

连接招租|手机版| ( 苏ICP备13006526号-1 )

GMT+8, 2024-6-1 08:57

  • 欢迎关注重庆发展,多发帖多回帖才能持续保持帐号活力哟!请不要发表任何政 治,领 导,官 员,人 事及其它违法违规类言论,以免帐号被封禁。感谢您的支持和理解!
经典重庆旗下网站 | 24小时客服:13424176859 308675020

爱重庆,爱上经典重庆! 爱重庆,就上经典重庆!

快速回复 返回顶部 返回列表