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 ...
随机推荐
- js绘制圆形时钟
纯js制作圆形时钟 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...
- ftp.GetResponse() 无法连接到远程服务器
最近在做一个ftp上传下载以及在服务器上创建文件夹的工具 报 GetResponse() 无法连接到远程服务器 错误 明明 ip , 账户和 密码 用ftp 工具都能连接上 ,可是 代码就不行了,看 ...
- javascript的Object对象的defineProperty和defineProperties
Object的属性 查看官网:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Obje ...
- linux编程之pipe()函数
管道是一种把两个进程之间的标准输入和标准输出连接起来的机制,从而提供一种让多个进程间通信的方法,当进程创建管道时,每次 都需要提供两个文件描述符来操作管道.其中一个对管道进行写操作,另一个对管道进行读 ...
- python进程join()函数理解
Join()是主程序等我这个进程执行完毕了,程序才往下走
- 谷歌发布"自动机器学习"技术 AI可自我创造
谷歌发布"自动机器学习"技术 AI可自我创造 据Inverse报道,今年5月份,谷歌宣布其人工智能(AI)研究取得重大进展,似乎帮助科幻小说中最耸人听闻的末日预言成为现实.谷歌推出 ...
- (八)git更改提交操作
1.git reset --hard + hash值 2.git reflog 查看当前仓库的操作日志 3.git commit --amend 修改提交信息(上一条) 4.git rebase -i ...
- 20145319 《网络渗透》web基础
20145319 <网络渗透>web基础 实验要求 掌握网页编程的基本知识 html语法 javascript php 前端,后台,数据库之间如何建立连接 掌握数据库的使用 mysql的启 ...
- #if 1...#endif
1. “#if 0/#if 1 ... #endif”的作用,我们知道,C标准不提供C++里的“//”这样的单行风格注释而只提供“/* */”这样的块注释功能,我们通常使用它写代码中说明性的注释文字( ...
- VC++ 删除一个文件目录下的所有文件以及目录
BOOL DoRemoveDirectory(CString chrDirName); BOOL ReleaseDirectory(CString chrDirName) { BOOL bRemove ...