书是:C++ Primer Plus 第6版 中文版
七合一答案如下:
#include<iostream>
using namespace std;
char32_t first(void);
char32_t last(void);
double fahrenheit(int);
double guangnian(double);
void time(int, int);
int main()
{
cout << "my name is 王冬" << endl;
cout << "my phone number is 13259991209" << endl;
cout << "————————————————————————————————————" << endl;
int long1;
cout << "请输入一个以long为单位的距离,这里将自动帮你转换为以码为单位的距离。" << endl;
cout << "请输入: ";
cin >> long1;
cout << long1 << "long = " << long1*220 << " 码。" << endl;
cout << "————————————————————————————————————" << endl;
first();
first();
last();
last();
cout << "————————————————————————————————————" << endl;
int age;
cout << "Enter your age: ";
cin >> age;
cout << "Your age have " << age * 12 << " month." << endl;
cout << "————————————————————————————————————" << endl;
int celsius;
cout << "Please enter a Celsius value: ";
cin >> celsius;
int b=fahrenheit(celsius);
cout << celsius << " degrees Celsius is " << b << " degrees Fahrenheit." << endl;
cout << "————————————————————————————————————" << endl;
double lightyears;
cout << "Enter the number of light yeasr: ";
cin >> lightyears;
cout << lightyears << " light years = " << guangnian(lightyears) << " astronomical units." << endl;
cout << "————————————————————————————————————" << endl;
int hours, minutes;
cout << "Enter the number of hours: ";
cin >> hours;
cout << "Enter the number of minutes: ";
cin >> minutes;
time(hours, minutes);
cout << "————————————————————————————————————" << endl;
system("pause");
return 0;
}
char32_t first()
{
cout << "Three blind me" << endl;
return 0;
}
char32_t last()
{
cout << "see how they run" << endl;
return 0;
}
double fahrenheit(int a)
{
int c;
c = 1.8*a + 32.0;
return c;
}
double guangnian(double a)
{
return a * 63240;
}
void time(int a, int b)
{
cout <<"Time: "<< a << ":" << b << endl;
}