﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-BinGo's</title><link>http://www.cppblog.com/bingo/</link><description /><language>zh-cn</language><lastBuildDate>Tue, 09 Jun 2026 20:21:48 GMT</lastBuildDate><pubDate>Tue, 09 Jun 2026 20:21:48 GMT</pubDate><ttl>60</ttl><item><title>test post.</title><link>http://www.cppblog.com/bingo/archive/2006/04/04/5006.html</link><dc:creator>BinGo and WhitNey's</dc:creator><author>BinGo and WhitNey's</author><pubDate>Tue, 04 Apr 2006 13:41:00 GMT</pubDate><guid>http://www.cppblog.com/bingo/archive/2006/04/04/5006.html</guid><wfw:comment>http://www.cppblog.com/bingo/comments/5006.html</wfw:comment><comments>http://www.cppblog.com/bingo/archive/2006/04/04/5006.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bingo/comments/commentRss/5006.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bingo/services/trackbacks/5006.html</trackback:ping><description><![CDATA[
		<font face="Courier New">
				<br />
		</font>
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<font face="Courier New">
						<span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> NewAlbum<br /></span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">{ <br /></span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">: <br /></span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> leastAmountOfCDs(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> nSongs, </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> length, </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> cdCapacity) <br /></span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">  { <br /></span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> m </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (cdCapacity</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">length);<br /></span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (m</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">13</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);"> ) m</span><span style="color: rgb(0, 0, 0);">--</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> result </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> nSongs</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">m </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> (nSongs</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">:</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">);<br /></span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> ((nSongs</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">m </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);"> nSongs</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">m ) </span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);"> nSongs</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">m</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">13</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">&amp;&amp;</span><span style="color: rgb(0, 0, 0);"> nSongs</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">m )<br /></span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">      result</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">;<br /></span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> result;<br /></span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);">  } <br /></span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">};</span></font>
		</div>
		<br />
		<br />
<img src ="http://www.cppblog.com/bingo/aggbug/5006.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bingo/" target="_blank">BinGo and WhitNey's</a> 2006-04-04 21:41 <a href="http://www.cppblog.com/bingo/archive/2006/04/04/5006.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>