⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list5.htm

📁 经典一百例(c语言版)
💻 HTM
📖 第 1 页 / 共 2 页
字号:
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序42】</font> <br>
  题目:学习使用auto定义变量的用法<br>
  1.程序分析:      <br>
  2.程序源代码:<br>
  #include &quot;stdio.h&quot;<br>
  main()<br>
  {int i,num;<br>
  num=2;<br>
   for (i=0;i&lt;3;i++)<br>
   { printf(&quot;\40: The num equal %d \n&quot;,num);<br>
    num++;<br>
    {<br>
    auto int num=1;<br>
    printf(&quot;\40: The internal block num equal %d \n&quot;,num);<br>
    num++;<br>
    }<br>
   }<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序43】</font><br>
  题目:学习使用static的另一用法。   <br>
  1.程序分析:<br>
  2.程序源代码:<br>
  #include &quot;stdio.h&quot;<br>
  main()<br>
  {<br>
  int i,num;<br>
  num=2;<br>
  for(i=0;i&lt;3;i++)<br>
  {<br>
  printf(&quot;\40: The num equal %d \n&quot;,num);<br>
  num++;<br>
  {<br>
  static int num=1;<br>
  printf(&quot;\40:The internal block num equal %d\n&quot;,num);<br>
  num++;<br>
  }<br>
  }<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序44】</font><br>
  题目:学习使用external的用法。<br>
  1.程序分析:<br>
  2.程序源代码:<br>
  #include &quot;stdio.h&quot;<br>
  int a,b,c;<br>
  void add()<br>
  { int a;<br>
  a=3;<br>
  c=a+b;<br>
  }<br>
  void main()<br>
  { a=b=4;<br>
  add();<br>
  printf(&quot;The value of c is equal to %d\n&quot;,c);<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序45】</font><br>
  题目:学习使用register定义变量的方法。<br>
  1.程序分析:<br>
  2.程序源代码:<br>
  void main()<br>
  {<br>
  register int i;<br>
  int tmp=0;<br>
  for(i=1;i&lt;=100;i++)<br>
  tmp+=i;<br>
  printf(&quot;The sum is %d\n&quot;,tmp);<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序46】</font><br>
  题目:宏#define命令练习(1)   <br>
  1.程序分析:<br>
  2.程序源代码:<br>
  #include &quot;stdio.h&quot;<br>
  #define TRUE 1<br>
  #define FALSE 0<br>
  #define SQ(x) (x)*(x)<br>
  void main()<br>
  {<br>
  int num;<br>
  int again=1;<br>
  printf(&quot;\40: Program will stop if input value less than 50.\n&quot;);<br>
  while(again)<br>
  {<br>
  printf(&quot;\40:Please input number==&gt;&quot;);<br>
  scanf(&quot;%d&quot;,&amp;num);<br>
  printf(&quot;\40:The square for this number is %d \n&quot;,SQ(num));<br>
  if(num&gt;=50)<br>
   again=TRUE;<br>
  else<br>
   again=FALSE;<br>
  }<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序47】</font><br>
  题目:宏#define命令练习(2)<br>
  1.程序分析:            <br>
  2.程序源代码:<br>
  #include &quot;stdio.h&quot;<br>
  #define exchange(a,b) { \ /*宏定义中允许包含两道衣裳命令的情形,此时必须在最右边加上&quot;\&quot;*/<br>
              int t;\<br>
              t=a;\<br>
              a=b;\<br>
              b=t;\<br>
             }<br>
  void main(void)<br>
  {<br>
  int x=10;<br>
  int y=20;<br>
  printf(&quot;x=%d; y=%d\n&quot;,x,y);<br>
  exchange(x,y);<br>
  printf(&quot;x=%d; y=%d\n&quot;,x,y);<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序48】</font><br>
  题目:宏#define命令练习(3)   <br>
  1.程序分析:<br>
  2.程序源代码:<br>
  #define LAG &gt;<br>
  #define SMA &lt;<br>
  #define EQ ==<br>
  #include &quot;stdio.h&quot;<br>
  void main()<br>
  { int i=10;<br>
  int j=20;<br>
  if(i LAG j)<br>
  printf(&quot;\40: %d larger than %d \n&quot;,i,j);<br>
  else if(i EQ j)<br>
  printf(&quot;\40: %d equal to %d \n&quot;,i,j);<br>
  else if(i SMA j)<br>
  printf(&quot;\40:%d smaller than %d \n&quot;,i,j);<br>
  else<br>
  printf(&quot;\40: No such value.\n&quot;);<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序49】</font><br>
  题目:#if #ifdef和#ifndef的综合应用。<br>
  1. 程序分析: <br>
  2.程序源代码:<br>
  #include &quot;stdio.h&quot;<br>
  #define MAX<br>
  #define MAXIMUM(x,y) (x&gt;y)?x:y<br>
  #define MINIMUM(x,y) (x&gt;y)?y:x<br>
  void main()<br>
  { int a=10,b=20;<br>
  #ifdef MAX<br>
  printf(&quot;\40: The larger one is %d\n&quot;,MAXIMUM(a,b));<br>
  #else<br>
  printf(&quot;\40: The lower one is %d\n&quot;,MINIMUM(a,b));<br>
  #endif<br>
  #ifndef MIN<br>
  printf(&quot;\40: The lower one is %d\n&quot;,MINIMUM(a,b));<br>
  #else<br>
  printf(&quot;\40: The larger one is %d\n&quot;,MAXIMUM(a,b));<br>
  #endif<br>
  #undef MAX<br>
  #ifdef MAX<br>
  printf(&quot;\40: The larger one is %d\n&quot;,MAXIMUM(a,b));<br>
  #else<br>
  printf(&quot;\40: The lower one is %d\n&quot;,MINIMUM(a,b));<br>
  #endif<br>
  #define MIN<br>
  #ifndef MIN<br>
  printf(&quot;\40: The lower one is %d\n&quot;,MINIMUM(a,b));<br>
  #else<br>
  printf(&quot;\40: The larger one is %d\n&quot;,MAXIMUM(a,b));<br>
  #endif<br>
  }<br>
  ==============================================================<br>
  <font color="#990000">【程序50】</font><br>
  题目:#include 的应用练习   <br>
  1.程序分析:<br>
  2.程序源代码:<br>
  test.h 文件如下:<br>
  #define LAG &gt;<br>
  #define SMA &lt;<br>
  #define EQ ==<br>
  #include &quot;test.h&quot; /*一个新文件50.c,包含test.h*/<br>
  #include &quot;stdio.h&quot;<br>
  void main()<br>
  { int i=10;<br>
  int j=20;<br>
  if(i LAG j)<br>
  printf(&quot;\40: %d larger than %d \n&quot;,i,j);<br>
  else if(i EQ j)<br>
  printf(&quot;\40: %d equal to %d \n&quot;,i,j);<br>
  else if(i SMA j)<br>
  printf(&quot;\40:%d smaller than %d \n&quot;,i,j);<br>
  else<br>
  printf(&quot;\40: No such value.\n&quot;);<br>
  }</p>
<p></p>
</body>
</html>

                          </p>
 </div> 

          </TD>
        </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=0 width=650 
align=center bgColor=#d7ebff  border=0>
  <TBODY> 
  <TR vAlign=center align=middle bgColor=#3986EF>
                <TD id=notice vAlign=center align=left colSpan=2 height=25>&nbsp;&nbsp;<font color="#ffffff"><b>[</b>来源<b>]</b>: 
                  beck&nbsp;&nbsp;&nbsp;
                  <b>[</b>编辑<b>]</b>: <font color=ffffff> 
                  beck
                  </font> &nbsp;&nbsp;&nbsp;<b>[</b>加入时间<b>]</b>:2002-8-11 </font>
              </TR></TBODY></TABLE>
</BODY>
<br>
<br>
              <table width="100%" border="0">
                <tr>
                  <td> 
                    <li><font color=#0772B1>上篇文章</font>:<a href="list.asp?id=206">经典c程序100例==31--40</a> 
                      
                    </li>
              
                    
                    <li><font color=#0772B1>下篇文章</font>:<a href="list.asp?id=208">经典c程序100例==51--60</a> 
                      
                    </li>
                  </td>
                  <td align="right">
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        
subcat[0] = new Array("C语言教程","8","35");
        
subcat[1] = new Array("C技术文章","8","36");
        
subcat[2] = new Array("C试题库","8","37");
        
subcat[3] = new Array("C程序百例","8","38");
        
subcat[4] = new Array("C函数库","8","39");
        
subcat[5] = new Array("数据结构教程","9","40");
        
subcat[6] = new Array("常用算法","9","41");
        
subcat[7] = new Array("在线测试","8","42");
        
subcat[8] = new Array("linux入门级","10","43");
        
onecount=9;

function changelocation(locationid)
    {
    document.myform.Nclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<form method="post" name="myform" action="ru_query.asp">
  文章搜索: 
  <select name="action" size="1">
<option value="title">按文章标题搜索</option>
<option value="writer">按文章来源搜索</option>
<option value="content">按文章内容搜索</option>
<option value="Nkey">按照关键词搜索</option>
</select>
<select name="classid" onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1">
	<option selected value="">请指定范围</option>
        
        <option value="8">C语言教室</option>
       
        
        <option value="9">数据结构</option>
       
        
        <option value="10">Linux初探</option>
       
        
       </select> 
    
    <select name="Nclassid">                  
        <option selected value="">请指定范围</option>
        
        <option value="8">C语言教程</option>
       
        
        <option value="8">C技术文章</option>
       
        
        <option value="8">C试题库</option>
       
        
        <option value="8">C程序百例</option>
       
        
        <option value="8">C函数库</option>
       
        
        <option value="9">数据结构教程</option>
       
        
        <option value="9">常用算法</option>
       
        
        <option value="8">在线测试</option>
       
        
        <option value="10">linux入门级</option>
       
        
    </select>
  <input type="text" name="keyword"  size=10 value="输入关键字" maxlength="50">
  <input type="submit" name="Submit" value="搜索">
</form></td>
                </tr>
              </table>
            </TD>
        </TR>
        <TR> 
            <TD bgColor="#e6e6e6" width="50%">□- C程序百例热点文章</TD>
            <TD bgColor="#e6e6e6" width="50%">□- 相关文章</TD>
        </TR>
        <tr> 
          <td width="50%" valign=top bgColor="#FFFFFF">
            1.<a href="list.asp?id=212" title="经典c程序100例==91--100" target=_top> 
            经典c程序100例==91--100
            </a>[阅读:<font color=red>162366</font>]<br>
            2.<a href="list.asp?id=203" title="经典c程序100例==1--10" target=_top> 
            经典c程序100例==1--10
            </a>[阅读:<font color=red>92965</font>]<br>
            3.<a href="list.asp?id=208" title="经典c程序100例==51--60" target=_top> 
            经典c程序100例==51--60
            </a>[阅读:<font color=red>72881</font>]<br>
            4.<a href="list.asp?id=204" title="经典c程序100例==11--20 " target=_top> 
            经典c程序100例==11--20 
            </a>[阅读:<font color=red>68461</font>]<br>
            5.<a href="list.asp?id=211" title="经典c程序100例==81--90 " target=_top> 
            经典c程序100例==81--90 
            </a>[阅读:<font color=red>63316</font>]<br>
            
          </td>
          <td width="50%" valign=top bgColor="#FFFFFF"> 
            
            <a href=list.asp?id=212>经典c程序100例==91--100</a><br>
            
            <a href=list.asp?id=211>经典c程序100例==81--90 </a><br>
            
            <a href=list.asp?id=210>经典c程序100例==71--80</a><br>
            
            <a href=list.asp?id=209>经典c程序100例==61--70</a><br>
            
            <a href=list.asp?id=208>经典c程序100例==51--60</a><br>
            
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </tbody>
</table>
 </div> 




<table width="778" border="0" bgcolor=ffffff>
  <tr bgcolor=ffffff> 
    <td colspan="3"> 
    </td>
  </tr>
  <tr valign="baseline"> 
    <td colspan="3"> 
      <hr noshade size="1">
    </td>
  </tr>
  <tr> 
    <td width="7%">&nbsp;</td>
    <td width="87%"> 
      <div align="center">唯C世界|<font face="Arial, Helvetica, sans-serif" >http://wWw.VcOk.Com</font>   <font face="Arial, Helvetica, sans-serif">Ver 
        1.00 Design By <font face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000"><a href="http://www.vcok.com"><font color="#FF0009">VcOk.com</font></a></font></b></font></font></font></div>
    </td>
    <td width="6%">&nbsp;</td>
  </tr>
  <tr> 
    <td width="7%">&nbsp;</td>
    <td width="87%">
      <div align="center"><font face="Arial, Helvetica, sans-serif">CopyRight 
        <font color="#FF0000">&copy;</font> .:.:.:2002-2008 AT Tie Ling Liaoning China:.:.:.</font></div>
    </td>
    <td width="6%">&nbsp;</td>
  </tr>
  <tr> 
    <td width="7%">&nbsp;</td>
    <td width="87%" align=center>&nbsp;&nbsp;&nbsp;&nbsp;辽宁省铁岭师专c语言研究中心 <u>杨志锋</u> 数学系 <u>杜博</u> &nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td width="6%">&nbsp;</td>
  </tr>

</table>

</BODY>                              
</html>                                 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -