#include void main(){ int c; float F; printf("CtF"); for(c=0;c
怎么用C语言简单编程之华氏温度与摄氏温度的转换,具体步骤如下:
材料/工具
电脑、VC++
#includevoidmain(){floatF,C;printf("请输入您需要转换的摄氏温度:");scanf("%f",&C);F=(C+32)*9/5.0;printf("其对应的华氏温度为:%.2fn",F);} main(){float C,F;scanf("%f",&F);C=5.0/9*(F-32);printf("%8.2f",C);} #include int main(void
方法
打开VC++,新建文件
;这个是c++的 楼主好像写错公式了, f代表华氏温度,c代表摄氏温度 #include #include void main() { double f,c,b; cout
编写如图程序
#include float change(float x); void main(){ float fahr; printf("请输入摄氏温度:"); scanf("%f",&fahr); printf("n对应的华氏温度为:%.1fnn",change(fahr)); } float change(float x){ float cent=x*9/5+32; return cent; }
运行,输入一个摄氏温度,点击回车,即可看见运行结果
C语言程序: #include int main(){double f, c;printf("请输入摄氏温度值:");scanf("%lf", &c);f = 9.0 / 5 * c + 32;printf("华氏温度值:%lfn", f);printf("请输入华氏温度值:");scanf("%lf", &f);c = (f - 32) * 5 / 9;printf("摄氏温度值
扩展阅读,以下内容您可能还感兴趣。
c语言编程,温度转换
#include<stdio.h>
int main()
{
int c;
float f;
scanf("%d",&c); //输入摄氏温度
printf("%.2f",c*9.0/5+32); //输出华氏温度, .2表示保留两位小zhidao数
return 0;
}追问谢谢!
这个题再帮我看看吧
问题描述
给定一个英文字母判断这个字母是大写还是小写。
输入格式
输入只包含一个英文字母c。
输出格式
如果c是大写字母,输出“upper”,否则输出“lower”。
样例输入
x
样例输出
lower
样例输入
B
样例输出
upper
给我讲一讲追答#include
int main()
{
char ch;
scanf("%c",&ch);
if(ch>='a' && ch='A' && ch<='Z')
printf("upper");
return 0;
}
C语言编程:输入一个华氏温度,要求输出摄氏温度,公式为:
#include <stdio.h>int main(){ double c, f; printf ("请输入华氏温度:百度"); scanf ("%lf", &f); c=5.0/9*(f-32); printf ("%g华氏温度是%.2f摄氏回温度n", f, c); return 0;}
扩展资料答:
#include<iostream>
using namespace std;
int main()
{
float f,c;
cout<<"请输入华氏温度:";
cin>>f;
c=5*(f-32)/9;
cout<<"摄氏温度为:"<<c<<endl;
return 0;
}
C语言编程摄氏温度转换为华氏温度
#include<stdio.h>
float change(float x);
void main(){
float fahr;
printf("请输入摄知氏温道度:");
scanf("%f",&fahr);
printf("\n对应的华氏版温度为:%权.1f\n\n",change(fahr));
}
float change(float x){
float cent=x*9/5+32;
return cent;
}
用C语言编写一个程序,从键盘上输入华氏温度,屏幕显示对应的摄氏温度。转换公式c=(f-32)/1.8
#include <stdio.h> void main() { double f,c,b; scanf("请输抄入华氏温百度度: %知f\n",&f); c=f-32; b=1.8; c=c/b; printf("对应的摄道氏温度为: %f\n",c); }
c语言:编写摄氏温度、华氏温度转换程序
#include<stdio.h>main()
{
来double C;
while(1){
scanf("%lf",&C);
printf("F = %lfn",(C+32)*9/5);
}
}
如图所示源,望采纳。zhidao。。。。。