C++华氏度转换为摄氏度练习
2018-03-02 20:50
330 查看
%% 练习函数的调用 可以在调试程序中尝试 来观察函数的参数传递
%% 函数的设置 类型 名字 参数(必须要指明类型)
%% void 是无类型的 在函数写的时候不确定类型是可以使用 充当类型
#include "stdafx.h"
#include "iostream"
#include "math.h"
using namespace std;
//int _tmain(int argc, _TCHAR* argv[])
float convert(float F){
float C;
C = (F - 32)*5 /9;
return C;
};
int main()
{
float F;
cout<<"please input the temperature in faherenheit :"<<endl;//华氏度
cin>>F;
cout<<"conver the temperature in celsius"<<endl;//摄氏度
F=convert(F);
cout<<F;
system("pause");
return F;
}
%% 函数的设置 类型 名字 参数(必须要指明类型)
%% void 是无类型的 在函数写的时候不确定类型是可以使用 充当类型
#include "stdafx.h"
#include "iostream"
#include "math.h"
using namespace std;
//int _tmain(int argc, _TCHAR* argv[])
float convert(float F){
float C;
C = (F - 32)*5 /9;
return C;
};
int main()
{
float F;
cout<<"please input the temperature in faherenheit :"<<endl;//华氏度
cin>>F;
cout<<"conver the temperature in celsius"<<endl;//摄氏度
F=convert(F);
cout<<F;
system("pause");
return F;
}
相关文章推荐
- C++_华氏度转换摄氏度
- 摄氏度华氏度转换
- 将摄氏度转换为华氏度程序
- iOS开发:App显示温度的时候,摄氏度和华氏度相互转换(为了适配美国等地区)
- 摄氏度到华氏度的转换
- 摄氏度和华氏度的转换
- 摄氏度转换成华氏度
- 第四周摄氏度转换华氏度
- 程序设计:摄氏度和华氏度间的转换
- 摄氏度与华氏度之间的转换
- c语言摄氏度华氏度转换
- property,摄氏度与华氏度的转换,get,set
- 摄氏度转换华氏度
- 2018.4.1(python)温度的刻画有两个不同体系:摄氏度(Celsius)和华氏度(Fabrenheit)。 请编写程序将用户输入华氏度转换为摄氏度,或将输入的摄氏度转换为华氏度。
- Mastering Regular Expression 代码介绍 - 摄氏度 华氏度 转换
- 第四讲项目2-3 将摄氏度转换为华氏度
- 摄氏度转换华氏度
- [C++ 写一个函数将十进制数转换为2到9的任意进制数 练习list容器]
- C++项目二(2):摄氏度的转换
- 摄氏度/华氏度转换(convert form degrees Celsius to degrees Fashrenheit)