#include<iostream>
int main()
{
std::cout<<"please enter your age"<<std::endl ;
int your_age ;
std::cin>>your_age ;
int your_month ;
your_month = your_age*12 ;
std::cout<<your_month<<std::endl ;
#include<iostream>
double change_degree(double a) ;
int main()
{
std::cout<<"please enter a Celsius degree"<<std::endl ;
int Celsius_degree ;
std::cin>>Celsius_degree ;
double Fah_degree ;
Fah_degree = change_degree(Celsius_degree) ;
std::cout<<Fah_degree ;
}
double change_degree(double a)
{
int result ;
result = a*1.8 +32 ;
return result ;
}
#include<iostream>
double trans_distance(double light_year) ;//实现光年和距离的转换
int main()
{
std::cout<<"please input a light_year"<<std::endl ;
double light_year ;
std::cin>>light_year ;
double distance ;
distance = trans_distance(light_year) ;
std::cout<<"now we got the distance"<<std::endl ;
std::cout<<distance<<std::endl ;
}
double trans_distance(double light_year)
{
int distance ;
distance = 63240*light_year ;
return distance ;
}
#include<iostream>
void cout_time(int hour ,int minite) ;//用于按时钟的形式输出某个时间
int main()
{
int hour ;
int minite ;
std::cout<<"Please input the hour and the minite"<<std::endl ;
std::cin>>hour>>minite ;
cout_time(hour ,minite) ;
}
void cout_time(int hour ,int minite)
{
std::cout<<hour<<":"<<minite<<std::endl ;
return ;
}