鱼C论坛

 找回密码
 立即注册
分享 C++Primer Plus 第六版编程练习8.8-1
2015-7-5 11:46
#include iostream using namespace std; void pr(char * p ,int n = 1) ; int main() { char *p = "I love my family!" ; for(int i=0 ;i10 ;i++) { pr(p) ; //正常调用 ...
个人分类: c++Primer Plus 第6版编程练习笔记|180 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-10
2015-7-4 15:40
#include iostream using namespace std; double add(double x ,double y); double sub(double x, double y) ; double mul(double x, double y) ; double calculate(double a,double b,double (*p)(double ,double )) ; int main() { //double (*pf )(double,double)={add,sub,mul};& ...
个人分类: c++Primer Plus 第6版编程练习笔记|231 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-9
2015-7-4 11:28
#include iostream #includestring using namespace std ; const int SLEN = 30 ; struct student { char fullname ; char hobby ; int ooplevel ; }; int getinfo(student pa ,int n) ; int main() { cout"Enter cl ...
个人分类: c++Primer Plus 第6版编程练习笔记|173 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-8(2)
2015-7-4 10:28
//方案2 #include iostream #includevector #include string using namespace std ; const int Seasons = 4 ; const string str1 = {"Spring" ,"Summer","Fall","Winter"} ; void fill(vectorint ) ; void show(vectorint::iterator , vectorint::iterator) ; int main() { &nb ...
个人分类: c++Primer Plus 第6版编程练习笔记|214 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-8(1)
2015-7-4 02:21
//方案1 #include iostream using namespace std ; const int Seasons = 4 ; const char str1 = {"Spring" ,"Summer","Fall","Winter"} ; void fill( int num ,int n) ; int main() { int num ; fill(num ,Seasons) ; show(num ,Seasons) ; &n ...
个人分类: c++Primer Plus 第6版编程练习笔记|92 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-7
2015-7-4 00:20
#include iostream using namespace std ; const int SIZE = 10 ; double * Fill_array(double *pa, int n) ; void Show_array(double *begin , double *end) ; void Reverse_array(double *begin , double *end) ; int main() { double num ; double * pe = Fill_array(n ...
个人分类: c++Primer Plus 第6版编程练习笔记|85 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-6
2015-7-3 23:33
C++Primer Plus 第六版编程练习7.13-6
#include iostream using namespace std ; const int SIZE = 10 ; int Fill_array(double num , int n) ; void Reverse_array(double num ; int count = Fill_array(num , SIZE) ; cout"一共输入了 "count" 个数字!\n" ; Show_array ...
个人分类: c++Primer Plus 第6版编程练习笔记|112 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-5
2015-7-3 22:30
#include iostream using namespace std; long unsigned recursive(unsigned x) ; //递归函数 int main() { cout"请输入一个无符号整数(q退出):" ; unsigned temp ; while(cintemp) { ...
个人分类: c++Primer Plus 第6版编程练习笔记|77 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-4
2015-7-3 22:15
#include iostream using namespace std ; double chance(unsigned all ,unsigned choice) ; //计算几率的函数 int main() { double fieldnumber = chance(47,5) ; double specialnumber = chance(27,1) ; cout"中头奖的几率为:"fieldnumbe ...
个人分类: c++Primer Plus 第6版编程练习笔记|104 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习7.13-2
2015-7-3 21:31
#include iostream using namespace std; const int SIZE = 10 ; void get_value(double * p) ; void show_value(const double * p) ; void count_value(const double * p) ; int main() { double arr = {0}; //这里定义数组为10的话容易下标越界 ,因为我是用不等于0 ...
个人分类: c++Primer Plus 第6版编程练习笔记|122 次阅读|0 个评论

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-4 00:01

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部