c++ primer plus 第二章 课后题答案
#include<iostream> using namespace std; int main()
{
cout << "My name is Jiantong Chen." << endl << "I'm a student in the Xi'an University.";
cin.get();
return ;
}
#include<iostream>
using namespace std; int main()
{
int a;
cout << "Please enter a number of the long:";
cin >> a;
cout << endl << "The ma of it is:" << (a*);
cin.get();
cin.get();
return ;
}
#include<iostream>
void print_1(void);
void print_2(void); using namespace std; int main()
{
print_1();
print_1();
print_2();
print_2();
cin.get();
return ;
} void print_1(void)
{
cout << "Three blind mice" << endl;
} void print_2(void)
{
cout << "See how they run" << endl;
}
#include<iostream> using namespace std; int main()
{
int age;
cout << "Enter you age:";
cin >> age;
cout << endl << "This age contains " << (age*) << " months.";
cin.get();
cin.get();
return ;
}
#include<iostream>
using namespace std;
double convert(double); int main()
{
int Celsius;
double Fahrenheit;
cout << "Please enter a Celsius value: ";
cin >> Celsius;
Fahrenheit = convert(Celsius);
cout << endl << Celsius << " degrees Celsius is " << Fahrenheit << " degrees Fahrenheit.";
cin.get();
cin.get();
return ;
} double convert(double Celsius)
{
double Fahrenheit;
Fahrenheit = 1.8*Celsius + 32.0;
return Fahrenheit;
}
#include<iostream>
using namespace std;
double convert(double); int main()
{
double in_put;
double out_put;
cout << "Enter the number of light years: ";
cin >> in_put;
out_put = convert(in_put);
cout << endl << in_put << " light years = " << out_put << " astronomical units.";
cin.get();
cin.get();
return ;
} double convert(double in_put)
{
double out_put;
out_put = in_put * ;
return out_put;
}
#include<iostream>
using namespace std;
void display(int, int); int main()
{
int hours;
int minutes; cout << "Enter the number of hours : ";
cin >> hours;
cout << "Enter the number of minutes : ";
cin >> minutes; display(hours, minutes);
cin.get();
cin.get();
return ;
} void display(int a,int b)
{
cout << "Time: " << a << ":" << b;
}
c++ primer plus 第二章 课后题答案的更多相关文章
- 《80x86汇编语言程序设计教程》第二章课后题答案
2.5 习题 2.1 数据寄存器 1. 八个通用寄存器除了各自规定的专门用途外,它们均可以用于传送和暂存数据,可以保存算术逻辑运算中的各种操作数和运算结果. 2.1 AX和Al寄存器又称为累加器(ac ...
- Java程序设计(2021春)——第二章课后题(选择题+编程题)答案与详解
Java程序设计(2021春)--第二章课后题(选择题+编程题)答案与详解 目录 Java程序设计(2021春)--第二章课后题(选择题+编程题)答案与详解 第二章选择题 2.1 面向对象方法的特性 ...
- c++ primer plus 第七章 课后题答案
#include <iostream> using namespace std; double HAR_AVG(double, double); void TEST(bool); int ...
- c++ primer plus 第六章 课后题答案
#include <iostream> #include <cctype> using namespace std; int main() { char in_put; do ...
- c++ primer plus 第五章 课后题答案
#include <iostream> using namespace std; int main() { ; cout << "Please enter two n ...
- c++ primer plus 第四章 课后题答案
#include<iostream> #include<string> using namespace std; int main() { string first_name; ...
- c++ primer plus 第三章 课后题答案
#include<iostream> using namespace std; int main() { ; int shen_gao; cout <<"Please ...
- python核心编程第4章课后题答案(第二版75页)
4-1Python objects All Python objects have three attributes:type,ID,and value. All are readonly with ...
- python核心编程第3章课后题答案(第二版55页)
3-4Statements Ues ; 3-5Statements Use\(unless part of a comma-separated sequence in which case \ is ...
随机推荐
- docker搭建本地仓库并制作自己的镜像
原文地址https://blog.csdn.net/junmoxi/article/details/80004796 1. 搭建本地仓库1.1 下载仓库镜像1.2 启动仓库容器2. 在CentOS容器 ...
- linux命令:压缩解压命令
压缩解压命令:gzip 命令名称:gzip 命令英文原意:GNU zip 命令所在路径:/bin/gzip 执行权限:所有用户 语法:gzip 选项 [文件] 功能描述:压缩文件 压缩后文件格式:g ...
- cocos代码研究(1)Node学习笔记
理论部分 Node类继承自Ref类,是cocos框架中基础底层的一个封装类,与画面渲染相关的类一般都是继承自该类,例如Scene,Layer,Sprite,Sprite3D,Label,SpriteB ...
- How To View the HTML Source in Google Chrome
Whether you are new to the web industry or a seasoned veteran, viewing the HTML source of different ...
- kafka监控工具之一--kafka-manager
部署环境 jdk7 kafka_2.10-0.9.0.1 xshell4 rhel-server-6.5 kafka-manager 是功能比较多的kafka管控工具. 安装方法一 安装方法二 步骤一 ...
- python 打印输出至文件中, 'wt'读写文件方式,会把原文件内容清空
会把原文件内容清空,写最新的 文件必须以文本模式打开,如果文件是二进制模式的话,打印会出错
- Python: ord()函数
ch() , unichr() , ord() ①chr()函数用一个范围在range(256)内的整数作参数,返回一个对应的字符. >>>chr(65) 'A' ②unichr() ...
- mysql B+Tree索引
原文地址:http://blog.codinglabs.org/articles/theory-of-mysql-index.html 数据结构及算法基础 索引的本质 MySQL官方对索引的定义为:索 ...
- 线程等待——CountDownLatch使用
告警性能优化过程中,遇到如下问题:1. 在数据库计算几十万个实体的KPI值的方差:2. 计算结果进行表格化处理. 这里KPI包含多个Counter的数据库函数运算(比如Decode,AVG等函数),方 ...
- Selenium2+python自动化54-unittest生成测试报告(HTMLTestRunner)
前言 批量执行完用例后,生成的测试报告是文本形式的,不够直观,为了更好的展示测试报告,最好是生成HTML格式的. unittest里面是不能生成html格式报告的,需要导入一个第三方的模块:HTMLT ...