考试吧综合考试论坛's Archiver

考友录-真实的考友社区,邀请注册中!

月光族 发表于 2007-10-4 07:56

软设天天练第50期(有详解)

<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US" style="FONT-SIZE: 14pt;"><font face="Times New Roman">&nbsp;8</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">
                                <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;include&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;include&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;main() <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;char&nbsp;str[81]</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">*sptr</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">
                                <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;i</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">
                                <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(i</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">0</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">i&lt;80</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">i++) <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;str[i]=getchar()</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">if(str[i]</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">’\n’)&nbsp;break;} <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str[i]</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">____________; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sptr</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">str</font></span><span style="FONT-SIZE: 14pt; 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="FONT-SIZE: 14pt;"><font face="Times New Roman">
                                <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(*&nbsp;sptr)&nbsp;putchar(*&nbsp;sptr______________); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br style="mso-special-character: line-break;"/><br style="mso-special-character: line-break;"/><p></p></font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US" style="FONT-SIZE: 14pt;"><p><font face="Times New Roman">&nbsp;</font></p></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US" style="FONT-SIZE: 14pt;"><p><font face="Times New Roman">&nbsp;</font></p></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span style="FONT-SIZE: 16pt; COLOR: red; 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="FONT-SIZE: 16pt; COLOR: red;"><p></p></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US" style="FONT-SIZE: 14pt;"><font face="Times New Roman">**** Hidden Message *****<p></p></span></font></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt;"><span lang="EN-US" style="COLOR: #333333; mso-bidi-font-size: 10.5pt;"><p><font face="Times New Roman">&nbsp;</font></p></span></p>

yhxman 发表于 2008-4-29 07:49

看看答案看看答案看看答案看看答案

keou 发表于 2008-4-29 16:11

软考我爱你 哈哈

zp19810828 发表于 2008-5-1 20:39

答案

1)'\0'
2)++

purplebolt 发表于 2008-5-7 18:08

回复 1楼 的帖子

我还需要学习我还需要学习

clm800627 发表于 2008-5-19 21:37

回复 1楼 的帖子

kkkjjkjjkjkjkhkhjhjlklh

jiushenchuan 发表于 2008-5-22 17:47

sdfsfasfasdfasdf

jjyy666 发表于 2008-5-22 20:55

答案答案答案答案答案答案答案答案答案答案答案答案答案答案答案答案

ahjya 发表于 2008-7-22 15:53

看看答案

看看答案看看答案看看答案看看答案

andyarmy 发表于 2008-7-22 23:41

看看答案看看答案看看答案看看答案

wuboyaogun 发表于 2008-7-23 14:16

我试一试

*sptr;
++;

suxc1982 发表于 2008-7-29 15:37

kan kan da an o .....

kitty322 发表于 2008-7-30 09:02

看看答案看看答案看看答案看看答案

kitty322@ 发表于 2008-9-21 17:01

看看解析
对对答案看看啦

answer0404 发表于 2008-10-12 18:34

aaaaaaaaaaaaaaaaaaaaaaaaaaaaa

lovelr 发表于 2008-10-13 23:12

看看结果是什么??????????

3642078 发表于 2008-10-27 22:42

不知道了(love11)

87kuaile 发表于 2008-11-4 09:18

rfwrwrewfsfsds

xingjia520 发表于 2008-11-23 10:44

(love01) (love00) (love03)

wjandwin 发表于 2008-11-25 09:42

'\0'      
++

页: [1] 2

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.