求助!为什么只有20分?
查看原帖
求助!为什么只有20分?
1079680
CASC_naxida楼主2023/11/5 10:22

求助!为什么我只有20分?我明明把最后的结果通过int()输出了,为什么还错了,之前的变量也用了int,后来用了double,就得了20分,用int只得了10分


#include<bits/stdc++.h>
using namespace std;
const int PI=3.14;
int main()
{
	double s,h,r;
	cin>>h>>r;
	s=r*r*PI;
	double v=s*h;
	double f=v/1000;
	cout<<int(20/f+1);
}
2023/11/5 10:22
加载中...