C语言问题,请大佬求助

如题所述

2.1

#include<stdio.h>
int main()
{
    float c,f;
    scanf("%f",&f);
    c=(f-32)/9*5;
    printf("%.2f\n", c);
    return 0;
}

2.2

#include<stdio.h>
#include<math.h>
int main()
{
    float f, x, y;
    scanf("%f%f",&x,&y);
    f=sqrt(pow(x,2)+pow(y,3));
    printf("f=%.2f\n", f);
    return 0;
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-03-13

试编写代码如下:

#include<stdio.h>
void main()
{
float f,c;
printf("请输入华氏温度:");
scanf("%f",&f); 
c = (5.0/9.0)*(f-32);
printf("%.2f\n",c);
}

运行截图:

本回答被网友采纳