C语言作业输入一个华氏温度,转换输出摄氏温度.转换公式为
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/07 22:37:03
printf("请输入一个整数%d:",x);printf("最大值为:%d\n",x);printf("最小值为:%d",z);我不明白,根据你的题意,应该用多分支的if语句的格式,即:if(表达式
因为你定义的变量是float类型,而如果输入5和9的话,电脑会认为是两个整形数据先相除,然后再转换成float型,所以就变成0了.
intmain(){floatc,f;printf("pleaseinputthef=");scanf("%f",&f);c=5/9*(f-32);printf("thec=%f",c);}再问:你运
#includevoidmain(){floatc,f;scanf("%f",&f);c=5.0/9*(e-32);printf("%f",c);}
代码#includevoidmain(){doublea,c;scanf("%lf",&a);c=9.0/5*(a-32);printf("%.2lf\n",c);}
#includeusingnamespacestd;main(){doublex,y;cout
if(s[i][0]=='0')“'0'”只是一个字符去掉看看.再问:这样我连编译都通不过
#includevoidmain(){floatc,f;printf(“请输入一个华氏温度:”)scanf(“%f”,&f);c=(f-32)/9;printf(“摄氏温度为:%5.2f\n”);}编
#include <stdio.h>void main (){ int a[10]; int i,k=0,n,min,
#includemain(){floatc,h;while(1){printf("PleaseinputtheC:");scanf("%f",&c);if(c!=0){printf("TheHis:%
#includeintmat[10][10];voidmain(){intn,i,j;intok=1;scanf("%d",&n);for(i=0;i
#includevoidmain(){floatF;floatC;scanf("%f",&F);printf("%f",C=5/9*(F-32);}采纳吧少年,这题我们刚做过
#include#include#defineE2.7182voidmain(void){floatx;floaty;scanf("%d",&x);if(x>=-1)y=pow(x,2)+1;
#includemain(){floatf,c;printf("pleaseenterF:");scanf("%f",&f);c=5.0*(f-32.0)/9.0printf("%f",c);}
#includemain(){floatF,C;charflag;loop:printf("Doyouwanttostart(y/n/q)?\n");flag=getch();if(flag=='q'
#include<stdio.h>int main(){ float F,c; &nbs
#includemain(){inti,j,k;chara[5][5];for(i=0;i再问:假如说i=0的话是不是就会输出一个空格再答:是的再问:那第一行就会输出空格了,题目是第二行才输出一个空格
#includeintmain(){floatF,c;while(1){printf("请输入华氏温度:");scanf("%f",&F);c=5*(F-32)/9;printf("摄氏温度为:%0.
#includeintmain(void){intn=0,m=0,i=0,j=0,k=0;scanf("%d",&n);while(n--){\x09scanf("%d",&m);\x09for(j=