第二章
#include<iostream>
using namespace std;
void no1() {
cout << "我的名字" << "我的地址" << endl;
}
void no2() {
long n;
cin >> n;
cout << n * 220 << "码" << endl;
}
void no3_1() {
cout << "Three blind mice" << endl;
}
void no3_2() {
cout << "See how they run" << endl;
}
void no3() {
no3_1();
no3_1();
no3_2();
no3_2();
}
void no4() {
cout << "Enter your age:" << endl;
int n;
cin >> n;
cout << n * 12 << endl;
}
double no5_sub(double Celsius) {
return Celsius * 1.8 + 32.0;
}
void no5() {
double Celsius;
cout << "Please enter a Celsius vlaue:";
cin >> Celsius;
double Fahrenheit=no5_sub(Celsius);
cout << Celsius << " degrees Celsius is " << Fahrenheit << " degrees Fahrenheit" << endl;
}
double no6_sub(double LY) {
return 63240* LY;
}
void no6() {
cout << "Enter the number of light years:";
double LY, astronomical;
cin >> LY;
astronomical = no6_sub(LY);
cout << LY << " light year = " << astronomical << " astronomical units." << endl;
}
void no7_sub(int h,int m) {
cout << "Time: " << h << ":" << m << endl;
}
void no7() {
int hours, minutes;
cout << "Enter the number of hours:";
cin >> hours;
cout << "Enter the number of minutes:";
cin >> minutes;
no7_sub(hours,minutes);
}