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

📄 subject_38540.htm

📁 vc
💻 HTM
字号:
<p>
序号:38540 发表者:max cai 发表日期:2003-05-04 15:37:15
<br>主题:关于排版的问题
<br>内容:我这三天在解决一个问题:关于排板的问题<BR>把一个字符串整齐输出到屏幕上,在换行的地方,如果是一个单词就比如l-<BR>ack<BR>如果一行的开头是空格,就把空格删地去。<BR>我是这样做的,先把字符串进行处理,然后再输出。<BR>有朋友叫我学WORD但WORD是通过改变字符间距来排的<BR>我是在用控制台写一个21点的游戏,我在写help文档。不能改变字符间距的。<BR>以下是代码<BR>for(i=0;i&lt;strRules.length();i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(i&gt;0&amp;&amp;i%77==0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(strRules[i]!=' '&amp;&amp;strRules[i+1]!=' ')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strRules.insert(i-1,"-");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else if(strRules[i+1]==' ')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strRules.erase(i+1,1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;for(i=0;i&lt;strRules.length();i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;strRules[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if((i&gt;0&amp;&amp;i==76)||(i&gt;77&amp;&amp;i%77==0))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;endl;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>请帮我看一下哪里有buger。如你要那个字符串作测试,在附件里。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:max cai 回复日期:2003-05-04 15:38:33
<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>
<font color=red>答案被接受</font><br>回复者:Justin Le 回复日期:2003-05-04 20:18:14
<br>内容:'原文<BR>Here are the rules: The game is played with a standard 208 card deck. The dealer<BR> will first give himself and player 2 cards, then he will ask the player hit or<BR>stop.If player hit dealer will give one more card until player stop. Make the to<BR>tal of all the card in one's hand. J,Q,K all count as 10. An Ace can count as an<BR> 11 or a 1. A natural 21 means an automatic win. If player hand's are larger,he<BR>or she win. If dealer hand's are larger,the playerlose. If player and dealer han<BR>d's are equal, then it's a tie. If player win,he or she will get the money which<BR> is same as bet. If player lose, he or she will lose the bet When the player get<BR> blackjack,he or she will get the money that is 125% of bet.<BR><BR>对齐后:<BR>Here are the rules: The game is played with a standard 208 c-<BR>ard deck. The dealer will first give himself and player 2 ca-<BR>rds, then he will ask the player hit or stop.If player hit d-<BR>ealer will give one more card until player stop. Make the to-<BR>tal of all the card in one's hand. J,Q,K all count as 10. An<BR>Ace can count as an 11 or a 1. A natural 21 means an automat-<BR>ic win. If player hand's are larger,he or she win. If dealer<BR>hand's are larger,the playerlose. If player and dealer hand's<BR>are equal, then it's a tie. If player win,he or she will get<BR>the money which is same as bet. If player lose, he or she wi-<BR>ll lose the bet When the player get blackjack,he or she will<BR>get the money that is 125% of bet.
<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 + -