您的位置:首页 > 编程语言 > C语言/C++

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;

 }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: