﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-C语言学习交流-随笔分类-疑难作业习题解答</title><link>http://www.cppblog.com/cstudy/category/1233.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 20 May 2008 07:56:49 GMT</lastBuildDate><pubDate>Tue, 20 May 2008 07:56:49 GMT</pubDate><ttl>60</ttl><item><title>谭浩强C习题答案</title><link>http://www.cppblog.com/cstudy/archive/2006/05/08/6720.html</link><dc:creator>我爱C</dc:creator><author>我爱C</author><pubDate>Sun, 07 May 2006 16:54:00 GMT</pubDate><guid>http://www.cppblog.com/cstudy/archive/2006/05/08/6720.html</guid><wfw:comment>http://www.cppblog.com/cstudy/comments/6720.html</wfw:comment><comments>http://www.cppblog.com/cstudy/archive/2006/05/08/6720.html#Feedback</comments><slash:comments>49</slash:comments><wfw:commentRss>http://www.cppblog.com/cstudy/comments/commentRss/6720.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cstudy/services/trackbacks/6720.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 注：这是老版的答案，基本和现在的版本相同，章节标号不同，因为以前没有现在的第二章的内容								第一章1.6main(){int a,b,c,max; printf("input three numbers:\n"); scanf("%d,%d,%d",&amp;a,&amp;b,&amp;c); max=a; if(max&lt;b)max=b; if(max&lt;c)max=c...&nbsp;&nbsp;<a href='http://www.cppblog.com/cstudy/archive/2006/05/08/6720.html'>阅读全文</a><img src ="http://www.cppblog.com/cstudy/aggbug/6720.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cstudy/" target="_blank">我爱C</a> 2006-05-08 00:54 <a href="http://www.cppblog.com/cstudy/archive/2006/05/08/6720.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>循环控制上机习题参考答案</title><link>http://www.cppblog.com/cstudy/archive/2006/04/27/6364.html</link><dc:creator>我爱C</dc:creator><author>我爱C</author><pubDate>Thu, 27 Apr 2006 02:40:00 GMT</pubDate><guid>http://www.cppblog.com/cstudy/archive/2006/04/27/6364.html</guid><wfw:comment>http://www.cppblog.com/cstudy/comments/6364.html</wfw:comment><comments>http://www.cppblog.com/cstudy/archive/2006/04/27/6364.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/cstudy/comments/commentRss/6364.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cstudy/services/trackbacks/6364.html</trackback:ping><description><![CDATA[
		<p>7.4<br />main()<br />{int a[11]={1,4,6,9,13,16,19,28,40,100};<br /> int temp1,temp2,number, end,i,j;<br /> scanf("%d",&amp;number);<br /> end=a[9];<br /> if(number&gt;end) a[10]=number;<br /> else <br />   {for(i=0;i&lt;10;i++)<br />      {if(a[i]&gt;number)<br />        {temp1=a[i];<br />         a[i]=number;<br />         for(j=i+1;j&lt;11;j++)<br />           {temp2=a[j];<br />            a[j]=temp1;<br />            temp1=temp2;<br />           }<br />         break;<br />         }<br />       }<br />     }<br /> for(i=0;i&lt;11;i++)<br />   printf("%6d",a[i]);<br />}</p>
		<p>7.5<br />#define N 5<br />main()<br />{int a[N]={8,6,5,4,1},i,temp;<br /> for(i=0;i&lt;N/2;i++)<br />   {temp=a[i];<br />    a[i]=a[N-i-1];<br />    a[N-i-1]=temp;<br />    }<br /> for(i=0;i&lt;N;i++)<br />   printf("%4d",a[i]);<br />}<br /><br />7.8<br />#define N 10<br />#define M 10<br />main()<br />{int i,j,k,m,n,flag1,flag2,a[N][M],max,maxi,maxj;<br /> scanf("%d,%d",&amp;n,&amp;m);<br /> for(i=0;i&lt;n;i++)<br />   for(j=0;j&lt;m;j++)<br />     scanf("%d",&amp;a[i][j]);<br /> flag2=0;<br /> for(i=0;i&lt;n;i++)<br />   {max=a[i][0];<br />    for(j=0;j&lt;m;j++)<br />      if(max&lt;a[i][j])<br />        {max=a[i][j];<br />         maxj=j;<br />        }<br />    for(k=0,flag1=1;k&lt;n&amp;&amp;flag1;k++)<br />      if(max&gt;a[k][maxj])flag1=0;<br />    if(flag1)<br />      { printf("\na[%d][%d]=%d\n",i,maxj,max);<br />        flag2=1;<br />      }<br />    }<br /> if(!flag2) printf("NOT");<br />}</p>
		<p> </p>
		<p>7.10<br />main()<br />{int i,j,uppn,lown,dign,span,othn;<br /> char text[3][80];<br /> uppn=lown=dign=span=othn=0;<br /> for(i=0;i&lt;3;i++)<br />   {gets(text[i]);<br />    for(j=0;j&lt;80&amp;&amp;text[i][j]!='\0';j++)<br />      {if(text[i][j]&gt;='A'&amp;&amp;text[i][j]&lt;='Z')<br />         uppn++;<br />       else if(text[i][j]&gt;='a'&amp;&amp;text[i][j]&lt;='z')<br />         lown++;<br />       else if(text[i][j]&gt;='0'&amp;&amp;text[i][j]&lt;='9')<br />         dign++;<br />       else if(text[i][j]==' ')<br />         span++;<br />       else <br />         othn++;<br />       }<br />    }<br /> for(i=0;i&lt;3;i++)<br />   printf("%s\n",text[i]);<br /> printf("uppn=%d\n",uppn);<br /> printf("lown=%d\n",lown);<br /> printf("dign=%d\n",dign);<br /> printf("span=%d\n",span);<br /> printf("othn=%d\n",othn);<br />}</p>
<img src ="http://www.cppblog.com/cstudy/aggbug/6364.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cstudy/" target="_blank">我爱C</a> 2006-04-27 10:40 <a href="http://www.cppblog.com/cstudy/archive/2006/04/27/6364.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>习题解答</title><link>http://www.cppblog.com/cstudy/archive/2006/03/27/4635.html</link><dc:creator>我爱C</dc:creator><author>我爱C</author><pubDate>Mon, 27 Mar 2006 00:51:00 GMT</pubDate><guid>http://www.cppblog.com/cstudy/archive/2006/03/27/4635.html</guid><wfw:comment>http://www.cppblog.com/cstudy/comments/4635.html</wfw:comment><comments>http://www.cppblog.com/cstudy/archive/2006/03/27/4635.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/cstudy/comments/commentRss/4635.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cstudy/services/trackbacks/4635.html</trackback:ping><description><![CDATA[
		<p>5.7 给一个不多于5位的正整数，要求：①求他是几位数；②分别打印出每一位数字；③按逆序打印出各位数字。<br />参考程序：</p>
		<p>main()<br />{   long int num;<br />     int  indiv,ten,hundred,thousand,ten_thousand,palce;/*分别代表个位,十位,百位,千位,万位和位数*/ <br />    printf("please input a integer(0-99999):");<br />   scanf("%ld",&amp;num);<br />  if(num&gt;9999)<br />    place=5;<br />   else if(num&gt;999)<br />    place=4;<br />  else if(num&gt;99)<br />   palce=3;<br />  else if(num&gt;9)<br />   place=2;<br />  else <br />   place =1;<br />printf("place=%d\n",place);<br /> ten_thousand=num/10000;<br /> thousand=(num-ten_thousand*10000)/1000;<br /> hundred=(num-ten_thousand*10000-thousand*1000)/100;<br /> ten=(num-ten_thousand*10000-thousand*1000-hundred*100)/10;<br /> indiv=num-ten_thousand*10000-thousand*1000-hundred*100-ten*10;<br /> switch(place)<br />   {case 5:printf("%d,%d,%d,%d,%d\n",ten_thousand,thousand,hundred,ten,indiv);<br />           printf("%d,%d,%d,%d,%d\n",indiv,ten,hundred,thousand,ten_thousand);<br />           break;<br />    case 4:printf("%d,%d,%d,%d\n",thousand,hundred,ten,indiv);<br />           printf("%d,%d,%d,%d\n",indiv,ten,hundred,thousand);<br />           break;<br />    case 3:printf("%d,%d,%d\n",hundred,ten,indiv);<br />           printf("%d,%d,%d\n",indiv,ten,hundred);<br />           break;<br />    case 2:printf("%d,%d\n",ten,indiv);<br />           printf("%d,%d\n",indiv,ten);<br />           break; <br />    case 1:printf("%d\n",indiv);<br />           printf("%d\n",indiv);<br />    }<br />}<br /></p>
<img src ="http://www.cppblog.com/cstudy/aggbug/4635.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cstudy/" target="_blank">我爱C</a> 2006-03-27 08:51 <a href="http://www.cppblog.com/cstudy/archive/2006/03/27/4635.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>