自己写了个小程序,请高手们帮忙下
#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 ();
}
这问题出在哪了? 展开
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 ();
}
这问题出在哪了? 展开
2个回答
展开全部
#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赋值后才能使用
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 广告
2024-10-22 广告
里艾传播,是基于受众洞察,整合多种营销方式,聚焦社交网络及搜索引擎,协助品牌和产品扩大其社会影响力的新形态传播公司。从品牌渠道招商、新品发布造势、电商节日大促等方面为合作品牌搭建一站式内容传播服务,从而满足品牌在不同阶段的营销需求,致力于成...
点击进入详情页
本回答由上海里艾提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询