//2.7编程练习
#include<iostream>
//1
/*
int main() {
using namespace std;
cout << "your name"<<endl;
cout << "your address";
cin.get();
return 0;
}
*/
//2
/*
int LongToYard(int);
int main() {
using namespace std;
int Long;
cout << "Please input the long :" << endl;
cin >> Long;
//int yard = LongToYard(Long);
cout << "The " << Long << " longs are " << LongToYard(Long) << " yards .";
cin.get();
return 0;
}
int LongToYard(int n) {
using namespace std;
return n * 220;
}
*/
//3
/*
void Tbm();
void Shtr();
int main() {
using namespace std;
Tbm();
Tbm();
Shtr();
Shtr();
//cout << Tbm() << endl << Tbm() << endl << Shtr() << endl << Shtr() << endl;
//这两个函数返回的是空值,cout无法进行输出
return 0;
}
void Tbm() {
using namespace std;
cout << "Three blind mice" << endl;
//cout << "Three blind mice" << endl;
}
void Shtr() {
using namespace std;
cout << "See how they run" << endl;
//cout << "See how they run" << endl;
}
*/
//4
/*
int Month(int);
int main() {
using namespace std;
int year;
cout << "Enter your age : ";
cin >> year;
cout << "Same as " << Month(year) << " months";
return 0;
}
int Month(int n) {
return n * 12;
}
*/
//5
/*
float cToF(float);
int main() {
using namespace std;
float Celsius;
cout << "Please enter a Celsius value: ";
cin >> Celsius;
cout << endl << Celsius << " degrees Celsius is " << cToF(Celsius) << " degrees Fahrenheit.";
return 0;
}
float cToF(float n) {
return 1.8*n + 32.0f;
}
*/
//6
/*
int Change(float);
int main() {
using namespace std;
float year;
cout << "Please enter the number of light years: ";
cin >> year;
cout <<endl<< year << " light years = " << Change(year) << " astronomical units.";
return 0;
}
int Change(float n) {
return n * 63240;
}
*/
//7
/*
void Time(int, int);
int main() {
using namespace std;
cout << "Enter the number of hours: ";
int hour, minute;
cin >> hour;
cout << endl << "Enter the number of minutes: ";
cin >> minute;
Time(hour, minute);
return 0;
}
void Time(int n, int m) {
using namespace std;
cout << "Time: " << n << ":" << m;
}
*/