会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
HuJiao粉
博客园
首页
新随笔
新文章
联系
管理
订阅
上一页
1
2
3
4
下一页
2021年3月20日
第十章练习题——308页
摘要: 10.10-1 #include<iostream>#include<string>using namespace std;class user{private://数据成员 string name; string account;//账号 double money;//存款 public://成员
阅读全文
posted @ 2021-03-20 10:03 HuJiao粉
阅读(24)
评论(0)
推荐(0)
2021年3月15日
第五章练习题——135页
摘要: 5.8-6 #include<iostream>int main(){ using namespace std; int i=1; while(i<=64) { cout<<i<<"、"; i=i*2; } cout<<endl; system("pause"); return 0;} 5.9-1
阅读全文
posted @ 2021-03-15 22:54 HuJiao粉
阅读(69)
评论(0)
推荐(0)
2021年3月13日
第五章 循环和关系表达式
摘要: 程序清单5.3 #include<iostream>int main(){ using namespace std; int x; cout<<"The expression x = 100 has the value "; cout<<(x=100)<<endl; cout<<"Now x = "
阅读全文
posted @ 2021-03-13 22:04 HuJiao粉
阅读(107)
评论(0)
推荐(0)
2021年3月10日
第四章练习题——102页
摘要: 4.12-13 #include<iostream>#include<vector>#include<array>using namespace std;int main(){ cout<<"Entre a positive integer:"; unsigned int num; cin>>num
阅读全文
posted @ 2021-03-10 22:55 HuJiao粉
阅读(55)
评论(0)
推荐(0)
程序清单4.20,4.21,4.22,4.23,4.24——课本92,95,95,98,100页
摘要: 如何使用不同形式的字符串 #include<iostream>#include<cstring>using namespace std;int main(){ char animal[20]="bear"; const char* bird="wren"; char* ps; cout<<anima
阅读全文
posted @ 2021-03-10 22:25 HuJiao粉
阅读(72)
评论(0)
推荐(0)
2021年3月9日
程序清单4.14,4.15,4.16,4.17,4.18,4.19——课本74,76,83,85,88,88页
摘要: 取地址运算符&用法 #include<iostream>using namespace std;int main(){ int donuts=6; double cups=4.5; cout<<"donuts value = "<<donuts; cout<<" and donuts address
阅读全文
posted @ 2021-03-09 22:55 HuJiao粉
阅读(94)
评论(0)
推荐(0)
2021年3月8日
程序清单4.11,4.12,4.13——课本74,76,77页
摘要: 在程序中使用结构 #include<iostream>using namespace std;struct inflatable{ char name[20]; float volume; double price;};int main(){ inflatable guest= { "Gloriou
阅读全文
posted @ 2021-03-08 22:43 HuJiao粉
阅读(57)
评论(0)
推荐(0)
2021年3月7日
程序清单4.8——课本69页
摘要: 1 可以将string对象声明为简单变量,而不是数组 #include<iostream>#include<string>using namespace std;int main(){ char charr1[20]; char charr2[20]="jaguar"; string str1; s
阅读全文
posted @ 2021-03-07 22:56 HuJiao粉
阅读(49)
评论(0)
推荐(0)
程序清单4.4,4.5,4.6——课本66,67页
摘要: 使用cin.getlint( ) #include<iostream>using namespace std;int main(){ const int ArSize=20; char name[ArSize]; char dessert[ArSize]; cout<<"Enter your nam
阅读全文
posted @ 2021-03-07 19:29 HuJiao粉
阅读(43)
评论(0)
推荐(0)
程序清单4.1——课本60页,马铃薯分析程序
摘要: #include<iostream>using namespace std;int main(){ int yams[3]; yams[0]=7; yams[1]=8; yams[2]=6; int yamcosts[3]={20,30,5}; cout<<"Total yams = "; cout
阅读全文
posted @ 2021-03-07 16:39 HuJiao粉
阅读(53)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告