鱼C论坛

 找回密码
 立即注册
分享 C++Primer Plus 第六版编程练习8.8-7
ltt1986 2015-7-6 22:46
#include iostream using namespace std; templatetypename T void ShowArray(T arr ,int n) ; //模版2 struct debts { char name ; double amount ; }; int main() { int things = {13,31,103,301,310,130} ; stru ...
个人分类: c++Primer Plus 第6版编程练习笔记|338 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习8.8-6
ltt1986 2015-7-6 22:18
#include iostream #include cstring using namespace std; templatetypename T T maxn(T num ,int n) ; //显式具体化 int main() { //测试 int num1 ={1,2,3,4,5,6} ; double num2 ={8.8,7.7,6.6,5.5} ; char *num3 = ...
个人分类: c++Primer Plus 第6版编程练习笔记|279 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习8.8-5
ltt1986 2015-7-6 21:17
#includeiostream using namespace std; templatetypename T T max5(T num ={0,1,2,3,4} ; double num2 ={8.8,7.7,6.6,5.5,4.4}; cout"整形数组中的最大值是:"max5(num1)endl ; cout"浮点型形数组中的最大值是:"max ...
个人分类: c++Primer Plus 第6版编程练习笔记|289 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习8.8-4
ltt1986 2015-7-6 21:03
#include iostream using namespace std; #include cstring struct stringy { char * str ; int ct ; }; void show(const char * , int n =1); void show(const stringy , int n=1) ; void set(stringy , char *) ; int main() { strin ...
个人分类: c++Primer Plus 第6版编程练习笔记|300 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习8.8-3
ltt1986 2015-7-6 19:21
#include iostream #include string using namespace std; void Str_Toupper(string ) ; int main() { string strtemp ; cout"Enter a string(q to quit):" ; while(getline(cin,strtemp)) { &nb ...
个人分类: c++Primer Plus 第6版编程练习笔记|298 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习8.8-2
ltt1986 2015-7-5 13:35
#include iostream #include cctype using namespace std; struct CandyBar { char name ; double weight ; int heat ; }; void set_(CandyBar cb,char *p = "Millennium" ,double x =2.85 , int y= 350 ) ; void show(const CandyBar ca ...
个人分类: c++Primer Plus 第6版编程练习笔记|315 次阅读|0 个评论
分享 C++Primer Plus 第六版编程练习8.8-1
ltt1986 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
ltt1986 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
ltt1986 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)
ltt1986 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 个评论
12下一页

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

GMT+8, 2024-5-4 08:27

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部