1.cpp
#include<iostream>
using namespace std;
int main()
{
cout<<"zjl "<<"anhui";
return 0;
}
2.cpp
#include<iostream>
using namespace std;
int main()
{
long dis;
cout << "请输入一个距离:" << endl;
cin >> dis;
cout << dis*220 << "码" <<endl;
return 0;
}
3.cpp
#include<iostream>
using namespace std;
void show_1();
void show_2();
int main()
{
show_1();
show_1();
show_2();
show_2();
return 0;
}
void show_1()
{
cout<<"Three blind mice"<<endl;
}
void show_2()
{
cout<<"See how they tun"<<endl;
}
4.cpp
#include<iostream>
using namespace std;
int main()
{
int age;
cout << "Enter your age:" <<endl;
cin>> age;
cout<< age*12 <<"个月"<<endl;
return 0;
}
5.cpp
#include<iostream>
using namespace std;
double tem(double t);
int main()
{
double t;
cout<<"Please enter a Celsius value:";
cin >> t;
cout<< t <<" degrees Celsius is "<<tem(t)<<" degrees Fahrenheit"<<endl;
return 0;
}
double tem(double t)
{
return 1.8*t+32.0;
}
6.cpp
#include<iostream>
using namespace std;
double tran_dis(double t);
int main()
{
double year;
cout<<"Enter the number of light years:";
cin>> year;
cout<< year <<" light years = "<<tran_dis(year)<<" astronomical units."<<endl;
return 0;
}
double tran_dis(double t)
{
return t*63240;
}
7.cpp
#include<iostream>
using namespace std;
void show(int hours,int minutes);
int main(){
int hours;
int minutes;
cout<<"Enter the number of hours:";
cin>>hours;
cout<<"Enter the number of minutes:";
cin>>minutes;
show(hours,minutes);
return 0;
}
void show(int hours,int minutes)
{
cout<<"Time: "<< hours <<":"<< minutes <<endl;
}