2-2求华氏温度100°F对应的摄氏温度

c表示摄氏温度
f表示华氏温度
已知转换公式为:c=5*(f-32)/9

#include <stdio.h>
int transfer(f)\\自定义函数
{
    return 5 * (f - 32) / 9;
}
int main()
{
    int f=100;
    int c;
    c = transfer(f);\\调用函数
    printf("%d\n", c);

    return 0;
}
发布了14 篇原创文章 · 获赞 2 · 访问量 283

猜你喜欢

转载自blog.csdn.net/qq_45969772/article/details/104671371
今日推荐