22004 温度转换

温度转换

https://ac.nowcoder.com/acm/problem/22004

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double f, c;
    cin>>f;
    c=5.0/9.0*(f-32);
    cout<<fixed<<setprecision(3)<<c;
    return 0;
}

答案正确:恭喜!您提交的程序通过了所有的测试用例
?


#include<bits/stdc++.h>
using namespace std;
int main()
{
    float f, c;
    cin>>f;
    c=5.0/9.0*(f-32.0);
    cout<<fixed<<setprecision(3)<<c;
    return 0;
}

答案错误:您提交的程序没有通过所有的测试用例
case通过率为40.00%


#include<bits/stdc++.h>
using namespace std;
int main()
{
    float f, c;
    cin>>f;
    c=5.0/9.0*(f-32.0);
    cout<<fixed<<setprecision(3)<<c<<;//setprecision(x)小数x位,fixed小数位数不够补零
    return 0;
}

编译错误:您提交的代码无法完成编译
a.cpp: In function 'int main()':
a.cpp:8:38: error: expected primary-expression before ';' token
cout< ^

?
...多了<<

全部评论

相关推荐

01-15 22:54
武汉大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务