以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 C/C++编程思想 』  (http://bbs.xml.org.cn/list.asp?boardid=61)
----  [求助] 一个简单的程序,但我确实忘了怎么编写  (http://bbs.xml.org.cn/dispbbs.asp?boardid=61&rootid=&id=37790)


--  作者:xxbv70
--  发布时间:9/11/2006 5:04:00 AM

--  [求助] 一个简单的程序,但我确实忘了怎么编写
Write a C++ program to figure up the cost of paint to paint a
rectangular area.  The area will be described in terms of square feet,
the paint will be specified in gallons. Input to the program the following:

               Length of the rectangle in feet
               Width of the rectangle in feet
               The number of gallons of paint needed to paint one square foot of area.
               The cost of one gallon of paint.

Output the following:
               The number of gallons of paint required.
               The cost in dollars of that amount of paint.

All of your variables should be declared as double.
Use the iomanip header and print the dollar amount with a dollar sign to 2 decimal places.


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms