#include <iostream>
using namespace std;
int main()
{
float deg;
int h,m;
cin>>h>>m;
deg=h*30 - m*6;
cout<<deg;
return 0;
}
h 和 m 是小时和分钟
问题以度为单位找出时针和分针之间的角度。
最佳答案
cout<< 固定;是答案
#include <iostream>
using namespace std;
int main()
{
float deg;
int h,m;
cin>>h>>m;
deg=h*30 - m*6;
cout<<fixed;
cout<<deg;
return 0;
}
关于c++ - 下面的代码应该为 4 和 0 的输入打印 120.000000。但它只显示 120。为什么?以及如何获得所需的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25919414/