资源简介
[C++ How to program C++大学教程 (第九版)]课后习题源代码,包含各章节习题源代码,帮助各位童鞋一起学习,一起进步!
代码片段和文件信息
// 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个文件信息
相关资源
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
- VC++基于OpenGL模拟的一个3维空间模型
- c++ 虚拟摄像头
- hook,捕获所有案件,查找所有窗口,
- C语言课设计算器
- c++ 简易贪吃蛇源码
- 高精度加法(c++代码)
- C++调用百度地图案例
- 北京化工大学计算方法(C/C++)讲义
- 基于VC++的SolidWorks二次开发SolidWorks
- c++ 模拟鼠标按键
- OFD编辑器
- Beginning C++17 From Novice to Professional
- C++ STL实现
- opencv手部轮廓识别以及轨迹识别
- 百度C++编码规范
- C++ sql2008 WebServer通讯.docx
- c++ 定时关机程序源码
- 基于VSCode和CMake实现C++开发
- c++语法查询工具
- c++ 账务系统源码
- GBT 28169-2011 嵌入式软件 C语言编码规范
- c++ 猜拳小游戏
- XUnZip Zip解压缩.rar
评论
共有 条评论