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

📄 subject_58899.htm

📁 vc
💻 HTM
字号:
<p>
序号:58899 发表者:小迅 发表日期:2003-11-04 18:48:24
<br>主题:一个问题,对你们应该不是个难题吧,进来指点一下
<br>内容:#include&lt;iostream.h&gt;<BR>void main()<BR>{<BR>int a;<BR>cin&gt;&gt;a;<BR>if(a%105==0)<BR>cout&lt;&lt;&#34;能同时被3,5,7整除\n&#34;;<BR>if(a%15==0)<BR>cout&lt;&lt;&#34;能同时被3,5整除\n&#34;;<BR>if(a%35==0)<BR>cout&lt;&lt;&#34;能同时被5,7整除\n&#34;;<BR>if(a%21==0)<BR>cout&lt;&lt;&#34;能同时被3,7整除\n&#34;; <BR>}<BR>输入105得到:<BR>能同时被3,5,7整除<BR>能同时被3,5整除<BR>能同时被5,7整除<BR>能同时被3,7整除<BR><BR>真正的结果只想得到:能同时被3,5,7整除<BR><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>
<font color=red>答案被接受</font><br>回复者:巴拉克 回复日期:2003-11-04 18:53:43
<br>内容:if(a%105==0){<BR>&nbsp;&nbsp; cout&lt;&lt;&#34;能同时被3,5,7整除\n&#34;;<BR>} else{<BR>&nbsp;&nbsp; if(a%15==0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&#34;能同时被3,5整除\n&#34;;<BR>&nbsp;&nbsp; if(a%35==0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&#34;能同时被5,7整除\n&#34;;<BR>&nbsp;&nbsp; if(a%21==0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;&#34;能同时被3,7整除\n&#34;; <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>
回复者:小迅 回复日期:2003-11-04 19:14:44
<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 + -