本文共 2183 字,大约阅读时间需要 7 分钟。
#includeusing std::cout;using std::endl;int main() { cout << "BeanGuohui" << endl; cout << "成都" << endl; getchar();}
#include#include using std::cin;using std::cout;using std::endl;int main() { cout << "请输入一个以long为单位的距离:"; double distance; cin >> distance; cout << distance << " long = " << distance * 220 << " 码" << endl; system("pause");}
#include#include using std::cout;using std::cin;using std::endl;void FirstPrint(){ cout << "Three blind mice" << endl;}void SecondPrint() { cout << "See how they run" << endl;}int main() { FirstPrint(); FirstPrint(); SecondPrint(); SecondPrint(); system("pause");}
#include#include using std::cout;using std::cin;using std::endl;int main() { cout << "Enter your age: "; int age = 0; cin >> age; cout << "该年龄包含" << age * 12 << "个月!" << endl; system("pause");}
#include#include using std::cout;using std::cin;using std::endl;double ChangeTemperature(double CentigradeTemperature) { return 1.8 * CentigradeTemperature + 32.0;}int main() { double CentigradeTemperature = 0; cout << "Please enter a Celsius value: "; cin >> CentigradeTemperature; cout << CentigradeTemperature << " degrees Celeius is " << ChangeTemperature(CentigradeTemperature) << " degrees Fahrenheit." << endl; system("pause");}
#include#include using std::cout;using std::cin;using std::endl;double changeLightYear(double lightYear) { return 63240 * lightYear;}int main() { double lightYear = 0; cout << "Enter the number of light years: "; cin >> lightYear; cout << lightYear << " light year = " << changeLightYear(lightYear) << " astronomical units." << endl; system("pause");}
#include#include using std::cout;using std::cin;using std::endl;void showData(int hour, int minute) { cout << "Time: " << hour << ":" << minute << endl;}int main() { int hour = 0, minute = 0; cout << "Enter the number of hours: "; cin >> hour; cout << "Enter the number of minutes: "; cin >> minute; showData(hour, minute); system("pause");}
转载地址:http://gkylf.baihongyu.com/