资源简介
[C++ How to program C++大学教程 (第九版)]课后习题源代码,包含各章节习题源代码,帮助各位童鞋一起学习,一起进步!
![](http://www.nz998.com/pic/62012.jpg)
代码片段和文件信息
// Fig. F.2: figF_02.cpp
// Using variable-length argument lists.
#include
#include
#include
using namespace std;
double average( int ... );
int main()
{
double double1 = 37.5;
double double2 = 22.5;
double double3 = 1.7;
double double4 = 10.2;
cout << fixed << setprecision( 1 ) << “double1 = “
<< double1 << “\ndouble2 = “ << double2 << “\ndouble3 = “
<< double3 << “\ndouble4 = “ << double4 << endl
<< setprecision( 3 )
<< “\nThe average of double1 and double2 is “
<< average( 2 double1 double2 )
<< “\nThe average of double1 double2 and double3 is “
<< average( 3 double1 double2 double3 )
<< “\nThe average of double1 double2 double3“
<< “ and double4 is “
<< average( 4 double1 double2 double3 double4 )
<< endl;
} // end main
// calculate average
double average( int count ... )
{
double total = 0;
va_list list; // for storing information needed by va_start
va_start( list count );
// process variable-length argument list
for ( int i = 1; i <= count; ++i )
total += va_arg( list double );
va_end( list ); // end the va_start
return total / count;
} // end function average
/**************************************************************************
* (C) Copyright 1992-2014 by Deitel & Associates Inc. and *
* Pearson Education Inc. All Rights Reserved. *
* *
* DISCLAIMER: The authors and publisher of this book have used their *
* best efforts in preparing the book. These efforts include the *
* development research and testing of the theories and programs *
* to determine their effectiveness. The authors and publisher make *
* no warranty of any kind expressed or implied with regard to these *
* programs or to the documentation contained in these books. The authors *
* and publisher shall not be liable in any event for incidental or *
* consequential damages in connection with or arising out of the *
* furnishing performance or use of these programs. *
**************************************************************************/
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2405 2013-03-10 10:43 Code_Examples\appF\figsF_02\figF_02.cpp
文件 2124 2013-03-10 10:43 Code_Examples\appF\figsF_03\figF_03.cpp
文件 2103 2013-03-10 10:43 Code_Examples\appF\figsF_04\figF_04.cpp
文件 2424 2013-03-10 10:43 Code_Examples\appF\figsF_06\figF_06.cpp
文件 1515 2013-03-10 10:43 Code_Examples\appF\figsF_07\figF_07.cpp
文件 1881 2013-03-10 10:43 Code_Examples\appF\figsF_08\figF_08.cpp
文件 2172 2013-03-10 10:43 Code_Examples\appF\figsF_09\figF_09.cpp
文件 2485 2011-01-31 13:13 Code_Examples\appH\Account.cpp
文件 1503 2011-01-31 13:16 Code_Examples\appH\Account.h
文件 1922 2011-01-31 13:13 Code_Examples\appH\figH_03.cpp
文件 2481 2011-02-11 22:18 Code_Examples\appI\Account.cpp
文件 1503 2011-01-31 13:16 Code_Examples\appI\Account.h
文件 1922 2011-01-31 13:13 Code_Examples\appI\figJ_03.cpp
文件 6148 2013-03-26 14:50 Code_Examples\appJ\Debugging\.DS_Store
文件 2485 2013-03-25 16:31 Code_Examples\appJ\Debugging\Debugging\Account.cpp
文件 1503 2013-03-25 16:31 Code_Examples\appJ\Debugging\Debugging\Account.h
文件 3124 2013-03-26 11:18 Code_Examples\appJ\Debugging\Debugging\Debugging.1
文件 1922 2013-03-26 14:01 Code_Examples\appJ\Debugging\Debugging\figJ_03.cpp
文件 7634 2013-03-26 11:19 Code_Examples\appJ\Debugging\Debugging.xcodeproj\project.pbxproj
文件 154 2013-03-26 11:18 Code_Examples\appJ\Debugging\Debugging.xcodeproj\project.xcworkspace\contents.xcworkspacedata
文件 31249 2013-03-26 15:00 Code_Examples\appJ\Debugging\Debugging.xcodeproj\project.xcworkspace\xcuserdata\pauldeitel.xcuserdatad\UserInterfaceState.xcuserstate
文件 225 2013-03-26 14:23 Code_Examples\appJ\Debugging\Debugging.xcodeproj\project.xcworkspace\xcuserdata\pauldeitel.xcuserdatad\xcdebugger\ex
文件 610 2013-03-26 14:49 Code_Examples\appJ\Debugging\Debugging.xcodeproj\xcuserdata\pauldeitel.xcuserdatad\xcdebugger\Breakpoints.xcbkptlist
文件 3143 2013-03-26 11:18 Code_Examples\appJ\Debugging\Debugging.xcodeproj\xcuserdata\pauldeitel.xcuserdatad\xcschemes\Debugging.xcscheme
文件 481 2013-03-26 11:18 Code_Examples\appJ\Debugging\Debugging.xcodeproj\xcuserdata\pauldeitel.xcuserdatad\xcschemes\xcschememanagement.plist
文件 2828 2011-01-31 13:13 Code_Examples\ch01\GuessNumber\GNU_Linux\GuessNumber.cpp
文件 275456 2005-06-10 10:37 Code_Examples\ch01\GuessNumber\Windows\GuessNumber.exe
文件 110201 2009-05-02 15:48 Code_Examples\ch01\GuessNumber\Windows\GuessNumber.ZIP
文件 1801 2012-12-22 13:21 Code_Examples\ch02\ex02_05.cpp
文件 1459 2012-09-29 08:59 Code_Examples\ch02\fig02_01.cpp
............此处省略706个文件信息
相关资源
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- vscode作为编辑器开发stm32f103c8
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
评论
共有 条评论