C++6.0求教,输入华氏温度F,计算对应摄氏温度,C=5/9*(F-32),怎么编写啊,新手

[复制链接]
查看11 | 回复4 | 2012-2-12 13:51:34 | 显示全部楼层 |阅读模式
#includeint main(){
float f;
do
{
printf("请输入华氏温度,输入-9999表示退出\n");
scanf("%f",&f);
// printf("%f",f);
if(f!=-9999)
{
float c;
c=(5.0/9.0)*(f-32.0);
printf("相应的摄氏温度为%f\n",c);
}
else
return 0;
}while(f!=-9999)...
回复

使用道具 举报

千问 | 2012-2-12 13:51:34 | 显示全部楼层
#include void main(){
float C,F;
printf("请输入需查询的华氏温度:");
scanf("%f",&F);
C=5/9*(F-32);
printf("对应摄氏温度是:%f\n",C);}...
回复

使用道具 举报

千问 | 2012-2-12 13:51:34 | 显示全部楼层
#include void main(){
float C,F;
scanf("%f",&F);
C=5/9*(F-32);
printf("%f\n",C);}...
回复

使用道具 举报

千问 | 2012-2-12 13:51:34 | 显示全部楼层
#include usingnamespace std;int main(void){double c = 0; //摄氏 double f = 0;//华氏 cout > f;c = 5.0 / 9.0 * (f - 32);cout << "...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行