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

📄 subject_60829.htm

📁 vc
💻 HTM
字号:
<p>
序号:60829 发表者:songhaiyang 发表日期:2003-11-15 20:15:30
<br>主题:一个C简单的问题?
<br>内容:我想输入20个数字,然后把他们打出来,帮帮看看Code里面那里错了<BR>#define 20<BR><BR>void student(int SM[], int Number)<BR>{<BR>int studentIndex;<BR><BR>&nbsp;&nbsp; printf(&#34;\n\tEnter the Student Mark&#34;);&nbsp;&nbsp;&nbsp;&nbsp; <BR>for(studentIndex=0;studentIndex&lt;=Number-1;studentIndex++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;<BR> scanf(&#34;%d&#34;,&amp;SM[studentIndex]);&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;printf(&#34;\n\tShow the students mark is :&#34;,SM[studentIndex]); <BR>&nbsp;&nbsp; }<BR><BR>}<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:zhaiyl 回复日期:2003-11-15 21:22:02
<br>内容:嘿嘿,看不太懂的说~~~<BR>这样显示效果不好啊<BR>另外第一句作用搞不清楚啊 <BR>#define 20 ???
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dprk 回复日期:2003-11-15 21:47:54
<br>内容:#define&nbsp;&nbsp;Number 20
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:dprk 回复日期:2003-11-15 23:02:15
<br>内容:#define&nbsp;&nbsp;Number 5<BR>#include &lt;iostream.h&gt;<BR>#include &lt;stdio.h&gt;<BR><BR>void main()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;int a[Number];<BR>&nbsp;&nbsp;&nbsp;&nbsp;int studentIndex;<BR>&nbsp;&nbsp;&nbsp;&nbsp;printf(&#34;\n\tEnter the Student Mark&#34;);&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;for(studentIndex=0;studentIndex&lt;=Number-1;studentIndex++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scanf(&#34;%d&#34;,&amp;a[studentIndex]); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //printf(&#34;a=%d\n&#34;, a[studentIndex]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //cout&lt;&lt;a[studentIndex]&lt;&lt;&#34;\n&#34;;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&#34;\n\tShow the students mark is : %d&#34;,a[studentIndex]); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&#34;\n&#34;);&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>}<BR>格式自己调吧!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:songhaiyang 回复日期:2003-11-16 03:29:10
<br>内容:为什么在for loop里面最后的时候用了两个printf?<BR><BR>scanf(&#34;%d&#34;,&amp;a[studentIndex]); <BR>printf(&#34;a=%d\n&#34;, a[studentIndex]);<BR>printf(&#34;\n\tShow the students mark is : %d&#34;,a[studentIndex]); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:songhaiyang 回复日期:2003-11-16 03:30:42
<br>内容:为什么在for loop里面最后的时候用了两个printf?<BR><BR>scanf(&#34;%d&#34;,&amp;a[studentIndex]); <BR>printf(&#34;a=%d\n&#34;, a[studentIndex]);<BR>printf(&#34;\n\tShow the students mark is : %d&#34;,a[studentIndex]); <BR>我原来只用了一个printf 不出现输入的结果<BR>第2个printf有什么用?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:zhaiyl 回复日期:2003-11-16 10:18:15
<br>内容:没见过这么写的。。。<BR>汗。。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dprk 回复日期:2003-11-16 14:04:50
<br>内容:前面一个不是屏蔽了么?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

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