📄 subject_60829.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> printf("\n\tEnter the Student Mark"); <BR>for(studentIndex=0;studentIndex<=Number-1;studentIndex++)<BR> { <BR> scanf("%d",&SM[studentIndex]); <BR><BR> printf("\n\tShow the students mark is :",SM[studentIndex]); <BR> }<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 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 Number 5<BR>#include <iostream.h><BR>#include <stdio.h><BR><BR>void main()<BR>{<BR> int a[Number];<BR> int studentIndex;<BR> printf("\n\tEnter the Student Mark"); <BR> for(studentIndex=0;studentIndex<=Number-1;studentIndex++)<BR> { <BR> scanf("%d",&a[studentIndex]); <BR> //printf("a=%d\n", a[studentIndex]);<BR> //cout<<a[studentIndex]<<"\n";<BR> printf("\n\tShow the students mark is : %d",a[studentIndex]); <BR> printf("\n"); }<BR> <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("%d",&a[studentIndex]); <BR>printf("a=%d\n", a[studentIndex]);<BR>printf("\n\tShow the students mark is : %d",a[studentIndex]); <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:30:42
<br>内容:为什么在for loop里面最后的时候用了两个printf?<BR><BR>scanf("%d",&a[studentIndex]); <BR>printf("a=%d\n", a[studentIndex]);<BR>printf("\n\tShow the students mark is : %d",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 + -