自己写了个小程序,请高手们帮忙下

#include<stdio.h>intmain(void){floatano;constdoublefah=ano*1;constdoublecel=fah*1.8+3... #include <stdio.h>
int main (void)
{

float ano;

const double fah = ano * 1 ;
const double cel = fah * 1.8 +32.0;
const double kel = cel + 273.16;

int status;

printf ("Enter a temperature you want to change:\n");

status = scanf("%f",&ano);

while(status==1)

{

printf ("%.2f in cel is %.2llf,in kel is %.2llf\n",fah,cel,kel);

printf ("Now enter another temperature:(no number to quit)\n");
status= scanf ("%f",&ano);
}
getch ();
}

这问题出在哪了?
展开
 我来答
phoc
2010-08-27 · 超过40用户采纳过TA的回答
知道小有建树答主
回答量:69
采纳率:0%
帮助的人:0
展开全部
#include <stdio.h>

int main (void)
{
float ano;
int status=1;

printf ("Enter a temperature you want to change:\n");
status = scanf("%f",&ano);

while(status==1)
{
const double fah = ano * 1;
const double cel = fah * 1.8 +32.0;
const double kel = cel + 273.16;

printf ("%.2lf in cel is %.2lf,in kel is %.2lf\n",fah,cel,kel);

printf ("Now enter another temperature:(no number to quit)\n");
status= scanf ("%f",&ano);
}
}

需先将ano赋值后才能使用
上海里艾
2024-10-22 广告
里艾传播,是基于受众洞察,整合多种营销方式,聚焦社交网络及搜索引擎,协助品牌和产品扩大其社会影响力的新形态传播公司。从品牌渠道招商、新品发布造势、电商节日大促等方面为合作品牌搭建一站式内容传播服务,从而满足品牌在不同阶段的营销需求,致力于成... 点击进入详情页
本回答由上海里艾提供
thinp
2010-08-27
知道答主
回答量:12
采纳率:0%
帮助的人:12.1万
展开全部
float ano;<--没有初始化

const double fah = ano * 1 ;
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式