C++华氏度转换为摄氏度练习

%%  练习函数的调用  可以在调试程序中尝试  来观察函数的参数传递

%% 函数的设置 类型 名字 参数(必须要指明类型)

%% 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;

 }

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值