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

📄 page_121.html

📁 Programming and Problem Solving with C++
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">	<html>		<head>			<title>page_121</title>			<link rel="stylesheet" href="reset.css" type="text/css" media="all">			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />		</head>		<body>		<table summary="top nav" border="0" width="100%">			<tr>				<td align="left" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_120.html">&lt;&nbsp;previous page</a></td>				<td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_121</strong></td>				<td align="right" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_122.html">next page&nbsp;&gt;</a></td>			</tr>					<tr>				<td align="left" colspan="3" style="background: #ffffff; padding: 20px;">    <table border="0" width="100%" cellpadding="0"><tr><td align="center">  <table border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td align="left"></td>  <td align="right"></td>  </tr></table></td></tr><tr><td align="left"><p></p><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="right"><font face="Times New Roman, Times, Serif" size="2" color="#FF0000">Page 121</font></td></tr></table><table border="0" cellspacing="0" cellpadding="0"><tr><td rowspan="5"></td>  <td colspan="3" height="12"></td>  <td rowspan="5"></td></tr><tr><td colspan="3"></td></tr><tr><td></td>  <td><font face="Courier New, Courier, Mono New, Courier, Mono" size="2">const聽float聽INCH_HEIGHT聽=聽30.0;聽聽聽聽聽//聽Height聽of聽a聽typical聽cone<br />const聽float聽INCH_DIAMETER聽=聽8.0;聽聽聽聽//聽Diameter聽of聽base聽of聽cone<br />const聽float聽RED_PRICE聽=聽0.10;聽聽聽聽聽聽聽//聽Price聽per聽square聽foot聽of聽red聽paint<br />const聽float聽BLUE_PRICE聽=聽0.15;聽聽聽聽聽聽//聽Price聽per聽square聽foot聽of聽blue聽paint<br />const聽float聽GREEN_PRICE聽=聽0.18;聽聽聽聽聽//聽Price聽per聽square聽foot聽of聽green聽paint<br />const聽float聽INCHES_PER_FOOT聽=聽12.0;聽//聽Inches聽in聽1聽foot<br />const聽float聽PI聽=聽3.14159265;聽聽聽聽聽聽聽聽//聽Ratio聽of聽circumference<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽聽聽to聽diameter聽(Remove聽this<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽聽聽declaration聽if聽your聽math.h<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽聽聽already聽declares聽PI)<br /><br />int聽main()<br />{<br />聽聽聽聽float聽heightInFeet;聽聽聽聽聽//聽Height聽of聽the聽cone聽in聽feet<br />聽聽聽聽float聽diameterInFeet;聽聽聽//聽Diameter聽of聽the聽cone聽in聽feet<br />聽聽聽聽float聽radius;聽聽聽聽聽聽聽聽聽聽聽//聽Radius聽of聽the聽cone聽in聽feet<br />聽聽聽聽float聽surfaceArea;聽聽聽聽聽聽//聽Surface聽area聽in聽square聽feet<br />聽聽聽聽float聽redCost;聽聽聽聽聽聽聽聽聽聽//聽Cost聽to聽paint聽a聽cone聽red<br />聽聽聽聽float聽blueCost;聽聽聽聽聽聽聽聽聽//聽Cost聽to聽paint聽a聽cone聽blue<br />聽聽聽聽float聽greenCost;聽聽聽聽聽聽聽聽//聽Cost聽to聽paint聽a聽cone聽green<br /><br />聽聽聽聽cout.setf(ios::fixed,聽ios::floatfield);聽聽聽//聽Set聽up聽floating聽pt.<br />聽聽聽聽cout.setf(ios::showpoint);聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽//聽聽聽output聽format<br /><br />聽聽聽聽//聽Convert聽dimensions聽to聽feet<br /><br />聽聽聽聽heightInFeet聽=INCH_HEIGHT聽/聽INCHES_PER_FOOT;<br />聽聽聽聽diameterInFeet聽=聽INCH_DIAMETER聽/聽INCHES_PER_FOOT;<br />聽聽聽聽radius聽=聽diameterInFeet聽/聽2.0;<br /><br />聽聽聽聽//聽Compute聽surface聽area聽of聽the聽cone<br /><br />聽聽聽聽surfaceArea聽=聽PI聽*聽radius聽*<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽sqrt(radius*radius聽+聽heightInFeet*heightInFeet);<br /><br />聽聽聽聽//聽Compute聽cost聽for聽each聽color<br /><br />聽聽聽聽redCost聽=聽surfaceArea聽*聽RED_PRICE;<br />聽聽聽聽blueCost聽=聽surfaceArea聽*聽BLUE_PRICE;<br />聽聽聽聽greenCost聽=聽surfaceArea聽*聽GREEN_PRICE;<br /><br />聽聽聽聽//聽Print聽results<br /></font></td><td></td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3" height="1"></td></tr></table></td></tr></table><p><font size="0"></font></p>  </td>			</tr>				<tr>				<td align="left" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_120.html">&lt;&nbsp;previous page</a></td>				<td align="center" width="40%" style="background: #EEF3E2"><strong style="color: #2F4F4F; font-size: 120%;">page_121</strong></td>				<td align="right" width="30%" style="background: #EEF3E2"><a style="color: blue; font-size: 120%; font-weight: bold; text-decoration: none; font-family: verdana;" href="page_122.html">next page&nbsp;&gt;</a></td>			</tr>		</table>		</body>	</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -