- 1、本文档共75页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
谭浩强 c++ 程序设计课后答案
娄警卫
..
PAGE
PAGE 2 / 75
第一章
return(m);
}
题
#include iostream using namespace std; int main()
{
coutThisis; coutaC++;
coutprogram.; return 0;
题
#include iostream using namespace std; int main()
{
int a,b,c; a=10; b=23;
c=a+b; couta+b=; coutc; coutendl; return 0;
}
七题
#include iostream using namespace std; int main()
{
int a,b,c;
int f(int x,int y,int z); cinabc; c=f(a,b,c); coutcendl; return 0;
题
#include iostream using namespace std; int main()
{
int a,b,c; cinab; c=a+b;
couta+b=a+bendl; return 0;
}
题
#include iostream using namespace std; int main()
{
int a,b,c;
int add(int x,int y); cinab; c=add(a,b);
couta+b=cendl; return 0;
}
int add(int x,int y)
{int z; z=x+y; return(z);
}
}
int f(int x,int y,int z)
{
int m;
if (xy) m=x; else m=y;
if (zm) m=z;
第二章
is:c1c2c3c4c5endl; return 0;
题
#include iostream using namespace std; int main()
{char c1=a,c2=b,c3=c,c4=\101,c5=\116; coutc1c2c3\n; cout\t\bc4\tc5\n;
return 0;
}
题
#include iostream using namespace std; int main()
{char c1=C,c2=+,c3=+;
coutI say: \c1c2c3\; cout\t\tHe says: \C++ is very
interesting!\ \n; return 0;
}
题
#include iostream using namespace std; int main()
{int i,j,m,n; i=8;
j=10; m=++i+j++; n=(++i)+(++j)+m;
couti\tj\tm\tnendl; return 0;
}
题
#include iostream using namespace std; int main()
{char c1=C, c2=h, c3=i, c4=n, c5=a; c1+=4;
c2+=4; c3+=4; c4+=4; c5+=4;
coutpassword
}
第三章
题
#include iostream #include iomanip using namespace std; int main ( )
{float h,r,l,s,sq,vq,vz;
const float pi=3.1415926; coutplease enter r,h:; cinrh;
l=2*pi*r; s=r*r*pi; sq=4*pi*r*r;
vq=3.0/4.0*pi*r*r*r; vz=pi*r*r*h;
coutsetiosflags(ios::fixed)setiosflags(ios:: right)
setprecision(2); coutl= setw(10)lendl;
couts= setw(10)sendl; coutsq=setw(10)sqendl; coutvq=setw(10)vqendl; coutvz=setw(10)vzendl; return 0;
}
题
#include iostream using namespace std; int main ()
{float c,f;
cout请输入一个华氏温度:; cinf;
c=(5.0/9.0)*(f-32); //注意 5 和 9
要用实型表示,否则 5/9 值为 0 cout摄氏温度为:cendl; return 0;
};
题
#include iostream using names
您可能关注的文档
- 苏教版2018三年级下英语单词默写.docx
- 苏教版八年级二次根式.docx
- 苏教版八年级全等三角形练习难题集锦.docx
- 苏教版八年级数学上册期末综合练习.docx
- 苏教版八年级物理光的折射透镜典型测试题及答案.docx
- 苏教版八年级英语阶段检测卷.docx
- 苏教版初三物理模拟试题.docx
- 苏教版初一数学二元一次方程组练习题.docx
- 苏教版二年级认识方向练习题.docx
- 苏教版二年级上册数学厘米和米练习题.docx
- 智慧港口物流监管平台建设方案.pptx
- 储能微电网解决方案.pptx
- 心肺复苏培训.ppt
- 智慧安防综合管理平台建设方案.pptx
- 五一劳动节介绍课件模版.pptx
- 第六章 衣袖款式造型 2 课件《服装纸样设计(第3版)》同步教学(中国纺织出版社).pptx
- 第七章 衣领款式造型 1 课件《服装纸样设计(第3版)》同步教学(中国纺织出版社).pptx
- 第七章 衣领款式造型2 课件《服装纸样设计(第3版)》同步教学(中国纺织出版社).pptx
- 第三章 服装的省位、褶裥变化 课件《服装纸样设计(第3版)》同步教学(中国纺织出版社).pptx
- 第十一章 服装纸样修正 1 课件《服装纸样设计(第3版)》同步教学(中国纺织出版社).pptx
最近下载
- 抖音个人账号运营方案.pptx VIP
- 三年级上册识字表+写字表生字组词、课后词语解释.docx VIP
- 南京市快速路内环及放射性连接段交通交通标志标线设置导则(最终稿).pdf
- 2024年国开一网平台电大《会计实务专题》形考作业1-4网考题库(附答案).pdf
- 管理信息系统-PPT课件(全).pptx
- 2024年广东华侨中学小升初分班考试数学模拟试卷附答案解析.docx
- 2024届“皖南八校”高三第一次大联考作文“拒绝‘贴标签’的青春,做不被定义的自己”导写及范文.docx
- 水电厂消防设备设施运行管理规程.doc
- 《小石潭记》原文及翻译.docx VIP
- 药物外渗预防及处理方法护理课件.pptx
文档评论(0)