📄 subject_59052.htm
字号:
<p>
序号:59052 发表者:jass 发表日期:2003-11-05 17:08:29
<br>主题:关于循环的小问题
<br>内容:#include<iostream.h><BR>void main()<BR>{<BR> int j,num[2][3];<BR> cout<<"Input 6 digiters: ";<BR> for(int i=0;i<2;i++)<BR> for(j=0;j<3;j++)<BR> cin>>num[i][j];<BR> for(i=0;i<2;i++)<BR> for(j=0;j<3;j++)<BR> if(num[i][j]<0)<BR> goto found;<BR> cout<<"not find!\n";<BR> goto end;<BR>found: cout<<"num["<<i<<"]["<<j<<"]="<<num[i][j]<<endl;<BR>end: ;<BR>}<BR> <BR>该程序不用goto怎么实现。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:飞翔的瞳眸 回复日期:2003-11-05 17:22:13
<br>内容:#include<iostream.h><BR>void main()<BR>{<BR>int j,num[2][3];<BR>cout<<"Input 6 digiters: ";<BR>for(int i=0;i<2;i++)<BR> for(j=0;j<3;j++)<BR> cin>>num[i][j];<BR> for(i=0;i<2;i++){<BR> for(j=0;j<3;j++){<BR> if(num[i][j]<0){<BR> cout<<"num["<<i<<"]["<<j<<"]="<<num[i][j]<<endl;<BR> exit(0);<BR> }<BR> }<BR> } <BR> cout<<"not find!\n";<BR>}<BR> <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 + -