首页
比赛
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
温度转换
96条解析
开通博客写题解
易烊千玺圈外女友
发表于 2021-05-14 20:15:19
遇到难点1:复制原式c=5/9*(f-32);得到结果为0.000,原因:整数相整除,不足1得0,0与其他相乘均为0解决:讲5或9改为5.0或9.0遇到难点2:不能全部通过解决:观察其他题解,将原本float c,f;改为double类型问题;不明白原理 #include <stdio.h&g
展开全文
已注销
发表于 2022-04-29 10:31:52
思路: 难点:5/9*(c-32)输出为0.00,因为5/9取模号/两端都是整数,故输出也是整数,要想输出浮点数,两端只要有一个是浮点数就可以了 ">int main(void) { double c=0.0; scanf("%lf",&c); printf("%.3
展开全文
张田懿
发表于 2020-12-12 12:56:54
include<bits/stdc++.h> using namespace std;int main(){ double f,c; cin>>f; c=(f-32)*5/9; printf("%.3lf",c);}
面向直男编程_重楼
发表于 2023-02-23 09:17:21
链接:https://ac.nowcoder.com/acm/problem/22004 来源:牛客网 题目描述 输入一个浮点数f, 表示华氏温度, 输出对应的摄氏温度c , c=5/9*(f-32) 输入描述: 输入一个浮点数f(1 <= f<= 100000) 输出描述: 输出浮
展开全文
一只咖啡君
发表于 2022-11-21 09:35:54
#include <stdio.h> int main() { float f; scanf("%f", &f); printf("%.3f", 5.0 / 9 * (f - 32)); return 0; }
牛客我是250号
发表于 2022-12-13 20:02:35
#include<bits/stdc++.h> int main(){ double c,f; scanf("%lf",&f); c=5.0/9.0*(f-32); printf("%.3lf\n",c); return 0; }
牛客645304895号
发表于 2022-04-05 17:25:37
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); d
展开全文
南湖星筱
发表于 2023-10-05 01:05:50
#include <stdio.h> int main() { float a; scanf("%f",&a); a=5.0/9*(a-32); printf("%.3f",a); return 0
展开全文
克里里克kliric
发表于 2024-07-08 17:20:20
#include <stdio.h> int main() { float f, c; scanf("%f", &f); c = 5 / 9.0 * (f - 32); printf("%.3f\n",
展开全文
每天捐款做慈善只为拿offer
发表于 2022-04-22 16:26:07
import java.util.Scanner; public class Main{ public static void main(String[]args){ Scanner in = new Scanner(System.in); double in
展开全文
查看本题
查看本题讨论
相关比赛
18163-阿尔法-C++习题课(2星)
进入比赛
18164-阿尔法-C++习题课(1~2星)
进入比赛
18201-2021暑假准大一生编程练习1
进入比赛
18214-编程练习之顺序结构
进入比赛
18388-暑假第一周Java基础训练
进入比赛
等你来战
查看全部
牛客练习赛139
报名截止时间:2025-05-23 21:30
牛客周赛 Round 94
报名截止时间:2025-05-25 21:00
牛客2025年儿童节比赛
报名截止时间:2025-06-01 21:00
衡阳师范学院第二十五届程序设计竞赛(同步赛)
报名截止时间:2025-06-08 18:00
2025牛客暑期多校训练营1
报名截止时间:2025-07-15 17:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题